1{
2 "swagger": "2.0",
3 "info": {
4 "title": "Merging Services",
5 "description": "This is an example of merging two proto files.",
6 "version": "version not set"
7 },
8 "tags": [
9 {
10 "name": "ServiceA"
11 },
12 {
13 "name": "ServiceC"
14 },
15 {
16 "name": "ServiceB"
17 }
18 ],
19 "consumes": [
20 "application/json"
21 ],
22 "produces": [
23 "application/json"
24 ],
25 "paths": {
26 "/v1/example/a/1": {
27 "post": {
28 "summary": "ServiceA.MethodOne receives InMessageA and returns OutMessageA",
29 "description": "Here is the detail explanation about ServiceA.MethodOne.",
30 "operationId": "ServiceA_MethodOne",
31 "responses": {
32 "200": {
33 "description": "A successful response.",
34 "schema": {
35 "$ref": "#/definitions/examplepbOutMessageA"
36 }
37 },
38 "default": {
39 "description": "An unexpected error response.",
40 "schema": {
41 "$ref": "#/definitions/rpcStatus"
42 }
43 }
44 },
45 "parameters": [
46 {
47 "name": "body",
48 "description": "InMessageA represents a message to ServiceA and ServiceC.",
49 "in": "body",
50 "required": true,
51 "schema": {
52 "$ref": "#/definitions/examplepbInMessageA"
53 }
54 }
55 ],
56 "tags": [
57 "ServiceA"
58 ]
59 }
60 },
61 "/v1/example/a/2": {
62 "post": {
63 "summary": "ServiceA.MethodTwo receives OutMessageA and returns InMessageA",
64 "description": "Here is the detail explanation about ServiceA.MethodTwo.",
65 "operationId": "ServiceA_MethodTwo",
66 "responses": {
67 "200": {
68 "description": "A successful response.",
69 "schema": {
70 "$ref": "#/definitions/examplepbInMessageA"
71 }
72 },
73 "default": {
74 "description": "An unexpected error response.",
75 "schema": {
76 "$ref": "#/definitions/rpcStatus"
77 }
78 }
79 },
80 "parameters": [
81 {
82 "name": "body",
83 "description": "OutMessageA represents a message returned from ServiceA.",
84 "in": "body",
85 "required": true,
86 "schema": {
87 "$ref": "#/definitions/examplepbOutMessageA"
88 }
89 }
90 ],
91 "tags": [
92 "ServiceA"
93 ]
94 }
95 },
96 "/v1/example/b/1": {
97 "post": {
98 "summary": "ServiceB.MethodOne receives InMessageB and returns OutMessageB",
99 "description": "Here is the detail explanation about ServiceB.MethodOne.",
100 "operationId": "ServiceB_MethodOne",
101 "responses": {
102 "200": {
103 "description": "A successful response.",
104 "schema": {
105 "$ref": "#/definitions/examplepbOutMessageB"
106 }
107 },
108 "default": {
109 "description": "An unexpected error response.",
110 "schema": {
111 "$ref": "#/definitions/rpcStatus"
112 }
113 }
114 },
115 "parameters": [
116 {
117 "name": "body",
118 "description": "InMessageB represents a message to ServiceB.",
119 "in": "body",
120 "required": true,
121 "schema": {
122 "$ref": "#/definitions/examplepbInMessageB"
123 }
124 }
125 ],
126 "tags": [
127 "ServiceB"
128 ]
129 }
130 },
131 "/v1/example/b/2": {
132 "post": {
133 "summary": "ServiceB.MethodTwo receives OutMessageB and returns InMessageB",
134 "description": "Here is the detail explanation about ServiceB.MethodTwo.",
135 "operationId": "ServiceB_MethodTwo",
136 "responses": {
137 "200": {
138 "description": "A successful response.",
139 "schema": {
140 "$ref": "#/definitions/examplepbInMessageB"
141 }
142 },
143 "default": {
144 "description": "An unexpected error response.",
145 "schema": {
146 "$ref": "#/definitions/rpcStatus"
147 }
148 }
149 },
150 "parameters": [
151 {
152 "name": "body",
153 "description": "OutMessageB represents a message returned from ServiceB.",
154 "in": "body",
155 "required": true,
156 "schema": {
157 "$ref": "#/definitions/examplepbOutMessageB"
158 }
159 }
160 ],
161 "tags": [
162 "ServiceB"
163 ]
164 }
165 },
166 "/v1/example/c/1": {
167 "post": {
168 "summary": "ServiceC.MethodOne receives InMessageA and returns OutMessageC",
169 "description": "Here is the detail explanation about ServiceC.MethodOne.",
170 "operationId": "ServiceC_MethodOne",
171 "responses": {
172 "200": {
173 "description": "A successful response.",
174 "schema": {
175 "$ref": "#/definitions/examplepbOutMessageC"
176 }
177 },
178 "default": {
179 "description": "An unexpected error response.",
180 "schema": {
181 "$ref": "#/definitions/rpcStatus"
182 }
183 }
184 },
185 "parameters": [
186 {
187 "name": "body",
188 "description": "InMessageA represents a message to ServiceA and ServiceC.",
189 "in": "body",
190 "required": true,
191 "schema": {
192 "$ref": "#/definitions/examplepbInMessageA"
193 }
194 }
195 ],
196 "tags": [
197 "ServiceC"
198 ]
199 }
200 },
201 "/v1/example/c/2": {
202 "post": {
203 "summary": "ServiceC.MethodTwo receives OutMessageA and returns InMessageA",
204 "description": "Here is the detail explanation about ServiceC.MethodTwo.",
205 "operationId": "ServiceC_MethodTwo",
206 "responses": {
207 "200": {
208 "description": "A successful response.",
209 "schema": {
210 "$ref": "#/definitions/examplepbInMessageA"
211 }
212 },
213 "default": {
214 "description": "An unexpected error response.",
215 "schema": {
216 "$ref": "#/definitions/rpcStatus"
217 }
218 }
219 },
220 "parameters": [
221 {
222 "name": "body",
223 "description": "OutMessageA represents a message returned from ServiceA.",
224 "in": "body",
225 "required": true,
226 "schema": {
227 "$ref": "#/definitions/examplepbOutMessageA"
228 }
229 }
230 ],
231 "tags": [
232 "ServiceC"
233 ]
234 }
235 }
236 },
237 "definitions": {
238 "examplepbInMessageA": {
239 "type": "object",
240 "properties": {
241 "values": {
242 "type": "array",
243 "items": {
244 "type": "string"
245 },
246 "title": "Here is the explanation about InMessageA.values"
247 }
248 },
249 "description": "InMessageA represents a message to ServiceA and ServiceC."
250 },
251 "examplepbInMessageB": {
252 "type": "object",
253 "properties": {
254 "value": {
255 "type": "string",
256 "title": "Here is the explanation about InMessageB.values"
257 }
258 },
259 "description": "InMessageB represents a message to ServiceB."
260 },
261 "examplepbOutMessageA": {
262 "type": "object",
263 "properties": {
264 "value": {
265 "type": "string",
266 "title": "Here is the explanation about OutMessageA.value"
267 }
268 },
269 "description": "OutMessageA represents a message returned from ServiceA."
270 },
271 "examplepbOutMessageB": {
272 "type": "object",
273 "properties": {
274 "values": {
275 "type": "array",
276 "items": {
277 "type": "string"
278 },
279 "title": "Here is the explanation about OutMessageB.value"
280 }
281 },
282 "description": "OutMessageB represents a message returned from ServiceB."
283 },
284 "examplepbOutMessageC": {
285 "type": "object",
286 "properties": {
287 "value": {
288 "type": "string",
289 "title": "Here is the explanation about OutMessageC.value"
290 }
291 },
292 "description": "OutMessageC represents a message returned from ServiceC."
293 },
294 "protobufAny": {
295 "type": "object",
296 "properties": {
297 "@type": {
298 "type": "string"
299 }
300 },
301 "additionalProperties": {}
302 },
303 "rpcStatus": {
304 "type": "object",
305 "properties": {
306 "code": {
307 "type": "integer",
308 "format": "int32"
309 },
310 "message": {
311 "type": "string"
312 },
313 "details": {
314 "type": "array",
315 "items": {
316 "type": "object",
317 "$ref": "#/definitions/protobufAny"
318 }
319 }
320 }
321 }
322 }
323}
View as plain text