blob: 35bbca50ddc7bfcfc83fc37f637f85b923c00d39 [file] [log] [blame]
Zsolt Harasztibae12752016-10-10 09:55:30 -07001{
2 "swagger": "2.0",
3 "info": {
4 "title": "test.proto",
5 "version": "version not set"
6 },
7 "schemes": [
8 "http",
9 "https"
10 ],
11 "consumes": [
12 "application/json"
13 ],
14 "produces": [
15 "application/json"
16 ],
17 "paths": {
18 "/v1/example/a_bit_of_everything": {
19 "post": {
20 "operationId": "CreateBody",
21 "responses": {
22 "200": {
23 "description": "",
24 "schema": {
25 "$ref": "#/definitions/examples.example.ABitOfEverything"
26 }
27 }
28 },
29 "parameters": [
30 {
31 "name": "body",
32 "in": "body",
33 "required": true,
34 "schema": {
35 "$ref": "#/definitions/examples.example.ABitOfEverything"
36 }
37 }
38 ],
39 "tags": [
40 "ABitOfEverythingService"
41 ]
42 }
43 },
44 "/v1/example/a_bit_of_everything/echo/{value}": {
45 "get": {
46 "operationId": "Echo",
47 "responses": {
48 "200": {
49 "description": "",
50 "schema": {
51 "$ref": "#/definitions/examples.sub.StringMessage"
52 }
53 }
54 },
55 "parameters": [
56 {
57 "name": "value",
58 "in": "path",
59 "required": true,
60 "type": "string",
61 "format": "string"
62 }
63 ],
64 "tags": [
65 "ABitOfEverythingService"
66 ]
67 }
68 },
69 "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{nonConventionalNameValue}": {
70 "post": {
71 "operationId": "Create",
72 "responses": {
73 "200": {
74 "description": "",
75 "schema": {
76 "$ref": "#/definitions/examples.example.ABitOfEverything"
77 }
78 }
79 },
80 "parameters": [
81 {
82 "name": "float_value",
83 "in": "path",
84 "required": true,
85 "type": "number",
86 "format": "float"
87 },
88 {
89 "name": "double_value",
90 "in": "path",
91 "required": true,
92 "type": "number",
93 "format": "double"
94 },
95 {
96 "name": "int64_value",
97 "in": "path",
98 "required": true,
99 "type": "string",
100 "format": "int64"
101 },
102 {
103 "name": "uint64_value",
104 "in": "path",
105 "required": true,
106 "type": "string",
107 "format": "uint64"
108 },
109 {
110 "name": "int32_value",
111 "in": "path",
112 "required": true,
113 "type": "integer",
114 "format": "int32"
115 },
116 {
117 "name": "fixed64_value",
118 "in": "path",
119 "required": true,
120 "type": "string",
121 "format": "uint64"
122 },
123 {
124 "name": "fixed32_value",
125 "in": "path",
126 "required": true,
127 "type": "integer",
128 "format": "int64"
129 },
130 {
131 "name": "bool_value",
132 "in": "path",
133 "required": true,
134 "type": "boolean",
135 "format": "boolean"
136 },
137 {
138 "name": "string_value",
139 "in": "path",
140 "required": true,
141 "type": "string",
142 "format": "string"
143 },
144 {
145 "name": "uint32_value",
146 "in": "path",
147 "required": true,
148 "type": "integer",
149 "format": "int64"
150 },
151 {
152 "name": "sfixed32_value",
153 "in": "path",
154 "required": true,
155 "type": "integer",
156 "format": "int32"
157 },
158 {
159 "name": "sfixed64_value",
160 "in": "path",
161 "required": true,
162 "type": "string",
163 "format": "int64"
164 },
165 {
166 "name": "sint32_value",
167 "in": "path",
168 "required": true,
169 "type": "integer",
170 "format": "int32"
171 },
172 {
173 "name": "sint64_value",
174 "in": "path",
175 "required": true,
176 "type": "string",
177 "format": "int64"
178 },
179 {
180 "name": "nonConventionalNameValue",
181 "in": "path",
182 "required": true,
183 "type": "string",
184 "format": "string"
185 }
186 ],
187 "tags": [
188 "ABitOfEverythingService"
189 ]
190 }
191 },
192 "/v1/example/a_bit_of_everything/{single_nested.name}": {
193 "post": {
194 "operationId": "DeepPathEcho",
195 "responses": {
196 "200": {
197 "description": "",
198 "schema": {
199 "$ref": "#/definitions/examples.example.ABitOfEverything"
200 }
201 }
202 },
203 "parameters": [
204 {
205 "name": "single_nested.name",
206 "in": "path",
207 "required": true,
208 "type": "string",
209 "format": "string"
210 },
211 {
212 "name": "body",
213 "in": "body",
214 "required": true,
215 "schema": {
216 "$ref": "#/definitions/examples.example.ABitOfEverything"
217 }
218 }
219 ],
220 "tags": [
221 "ABitOfEverythingService"
222 ]
223 }
224 },
225 "/v1/example/a_bit_of_everything/{uuid}": {
226 "get": {
227 "operationId": "Lookup",
228 "responses": {
229 "200": {
230 "description": "",
231 "schema": {
232 "$ref": "#/definitions/examples.example.ABitOfEverything"
233 }
234 }
235 },
236 "parameters": [
237 {
238 "name": "uuid",
239 "in": "path",
240 "required": true,
241 "type": "string",
242 "format": "string"
243 }
244 ],
245 "tags": [
246 "ABitOfEverythingService"
247 ]
248 },
249 "delete": {
250 "operationId": "Delete",
251 "responses": {
252 "200": {
253 "description": "",
254 "schema": {
255 "$ref": "#/definitions/google.protobuf.Empty"
256 }
257 }
258 },
259 "parameters": [
260 {
261 "name": "uuid",
262 "in": "path",
263 "required": true,
264 "type": "string",
265 "format": "string"
266 }
267 ],
268 "tags": [
269 "ABitOfEverythingService"
270 ]
271 },
272 "put": {
273 "operationId": "Update",
274 "responses": {
275 "200": {
276 "description": "",
277 "schema": {
278 "$ref": "#/definitions/google.protobuf.Empty"
279 }
280 }
281 },
282 "parameters": [
283 {
284 "name": "uuid",
285 "in": "path",
286 "required": true,
287 "type": "string",
288 "format": "string"
289 },
290 {
291 "name": "body",
292 "in": "body",
293 "required": true,
294 "schema": {
295 "$ref": "#/definitions/examples.example.ABitOfEverything"
296 }
297 }
298 ],
299 "tags": [
300 "ABitOfEverythingService"
301 ]
302 }
303 },
304 "/v2/example/echo": {
305 "get": {
306 "operationId": "Echo",
307 "responses": {
308 "200": {
309 "description": "",
310 "schema": {
311 "$ref": "#/definitions/examples.sub.StringMessage"
312 }
313 }
314 },
315 "tags": [
316 "ABitOfEverythingService"
317 ]
318 },
319 "post": {
320 "operationId": "Echo",
321 "responses": {
322 "200": {
323 "description": "",
324 "schema": {
325 "$ref": "#/definitions/examples.sub.StringMessage"
326 }
327 }
328 },
329 "parameters": [
330 {
331 "name": "body",
332 "in": "body",
333 "required": true,
334 "schema": {
335 "$ref": "#/definitions/examples.sub.StringMessage"
336 }
337 }
338 ],
339 "tags": [
340 "ABitOfEverythingService"
341 ]
342 }
343 },
344 "/v2/example/timeout": {
345 "get": {
346 "operationId": "Timeout",
347 "responses": {
348 "200": {
349 "description": "",
350 "schema": {
351 "$ref": "#/definitions/google.protobuf.Empty"
352 }
353 }
354 },
355 "tags": [
356 "ABitOfEverythingService"
357 ]
358 }
359 }
360 },
361 "definitions": {
362 "examples.example.ABitOfEverything.Nested": {
363 "type": "object",
364 "properties": {
365 "amount": {
366 "type": "integer",
367 "format": "int64"
368 },
369 "name": {
370 "type": "string",
371 "format": "string",
372 "description": "name is nested field."
373 },
374 "ok": {
375 "$ref": "#/definitions/examples.example.ABitOfEverything.Nested.DeepEnum"
376 }
377 },
378 "description": "Nested is nested type."
379 },
380 "examples.example.ABitOfEverything.Nested.DeepEnum": {
381 "type": "string",
382 "enum": [
383 "FALSE",
384 "TRUE"
385 ],
386 "default": "FALSE",
387 "description": "DeepEnum is one or zero.\nValid values:\n - FALSE: FALSE is false.\n - TRUE: TRUE is true."
388 },
389 "examples.example.ABitOfEverything": {
390 "type": "object",
391 "properties": {
392 "bool_value": {
393 "type": "boolean",
394 "format": "boolean"
395 },
396 "double_value": {
397 "type": "number",
398 "format": "double"
399 },
400 "enum_value": {
401 "$ref": "#/definitions/examples.example.NumericEnum"
402 },
403 "fixed32_value": {
404 "type": "integer",
405 "format": "int64"
406 },
407 "fixed64_value": {
408 "type": "string",
409 "format": "uint64"
410 },
411 "float_value": {
412 "type": "number",
413 "format": "float"
414 },
415 "int32_value": {
416 "type": "integer",
417 "format": "int32"
418 },
419 "int64_value": {
420 "type": "string",
421 "format": "int64"
422 },
423 "map_value": {
424 "type": "object",
425 "additionalProperties": {
426 "$ref": "#/definitions/examples.example.NumericEnum"
427 }
428 },
429 "mapped_nested_value": {
430 "type": "object",
431 "additionalProperties": {
432 "$ref": "#/definitions/examples.example.ABitOfEverything.Nested"
433 }
434 },
435 "mapped_string_value": {
436 "type": "object",
437 "additionalProperties": {
438 "type": "string",
439 "format": "string"
440 }
441 },
442 "nested": {
443 "type": "array",
444 "items": {
445 "$ref": "#/definitions/examples.example.ABitOfEverything.Nested"
446 }
447 },
448 "nonConventionalNameValue": {
449 "type": "string",
450 "format": "string"
451 },
452 "oneof_empty": {
453 "$ref": "#/definitions/google.protobuf.Empty"
454 },
455 "oneof_string": {
456 "type": "string",
457 "format": "string"
458 },
459 "repeated_string_value": {
460 "type": "array",
461 "items": {
462 "type": "string",
463 "format": "string"
464 }
465 },
466 "sfixed32_value": {
467 "type": "integer",
468 "format": "int32"
469 },
470 "sfixed64_value": {
471 "type": "string",
472 "format": "int64"
473 },
474 "single_nested": {
475 "$ref": "#/definitions/examples.example.ABitOfEverything.Nested"
476 },
477 "sint32_value": {
478 "type": "integer",
479 "format": "int32"
480 },
481 "sint64_value": {
482 "type": "string",
483 "format": "int64"
484 },
485 "string_value": {
486 "type": "string",
487 "format": "string"
488 },
489 "timestamp_value": {
490 "type": "string",
491 "format": "date-time"
492 },
493 "uint32_value": {
494 "type": "integer",
495 "format": "int64",
496 "description": "TODO(yugui) add bytes_value"
497 },
498 "uint64_value": {
499 "type": "string",
500 "format": "uint64"
501 },
502 "uuid": {
503 "type": "string",
504 "format": "string"
505 }
506 },
507 "description": "Intentionaly complicated message type to cover much features of Protobuf.\n NEXT ID: 27"
508 },
509 "examples.example.NumericEnum": {
510 "type": "string",
511 "enum": [
512 "ZERO",
513 "ONE"
514 ],
515 "default": "ZERO",
516 "description": "NumericEnum is one or zero.\nValid values:\n - ZERO: ZERO means 0\n - ONE: ONE means 1"
517 },
518 "google.protobuf.Empty": {
519 "type": "object",
520 "description": "A generic empty message that you can re-use to avoid defining duplicated\n empty messages in your APIs. A typical example is to use it as the request\n or the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\n The JSON representation for `Empty` is empty JSON object `{}`."
521 },
522 "sub2.IdMessage": {
523 "type": "object",
524 "properties": {
525 "uuid": {
526 "type": "string",
527 "format": "string"
528 }
529 }
530 },
531 "examples.sub.StringMessage": {
532 "type": "object",
533 "properties": {
534 "value": {
535 "type": "string",
536 "format": "string"
537 }
538 }
539 }
540 }
541}