-
-
Notifications
You must be signed in to change notification settings - Fork 753
/
api.yaml
667 lines (652 loc) · 17.4 KB
/
api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
swagger: "2.0"
info:
title: "{{title}}"
version: "1.0"
basePath: /v1.0
securityDefinitions:
oauth:
type: oauth2
flow: password
tokenUrl: https://ouath.example/token
x-tokenInfoUrl: https://ouath.example/token_info
scopes:
myscope: can do stuff
something_else:
type: something_else
paths:
/greeting/{name}:
post:
summary: Generate greeting
description: Generates a greeting message.
operationId: fakeapi.hello.post_greeting
responses:
200:
description: greeting response
schema:
type: object
parameters:
- name: name
in: path
description: Name of the person to greet.
required: true
type: string
/greetings/{name}:
get:
summary: Generate greeting
description: Generates a greeting message with custom mimetype
operationId: fakeapi.hello.get_greetings
produces:
- application/x.connexion+json
responses:
200:
description: greeting response
schema:
type: object
parameters:
- name: name
in: path
description: Name of the person to greet.
required: true
type: string
/bye/{name}:
get:
summary: Generate goodbye
description: Generates a goodbye message.
operationId: fakeapi.hello.get_bye
produces:
- text/plain
responses:
200:
description: goodbye response
schema:
type: string
default:
description: "unexpected error"
schema:
$ref: "#/definitions/errorModel"
parameters:
- name: name
in: path
description: Name of the person to say bye.
required: true
type: string
/problem:
get:
summary: Fails
description: Fails
operationId: fakeapi.hello.with_problem
produces:
- application/json
responses:
200:
description: goodbye response
schema:
type: string
/other_problem:
get:
summary: Fails
description: Fails
operationId: fakeapi.hello.with_problem_txt
produces:
- text/plain
security: # this will be ignored
- something_else:
- scope
responses:
200:
description: goodbye response
schema:
type: string
/list/{name}:
get:
summary: Generate a greeting in a list
description: Generate a greeting in a list
operationId: fakeapi.hello.get_list
produces:
- application/json
security: # this will disable security
- oauth:
- myscope
- something_else
responses:
200:
description: a greeting in a list
schema:
type: array
items:
type: string
parameters:
- name: name
in: path
description: Name of the person to say hello to.
required: true
type: string
/byesecure/{name}:
get:
summary: Generate goodbye
description: Generates a goodbye message.
operationId: fakeapi.hello.get_bye_secure
security:
- oauth:
- myscope
produces:
- text/plain
responses:
200:
description: goodbye response
schema:
type: string
parameters:
- name: name
in: path
description: Name of the person to say bye.
required: true
type: string
/except:
get:
summary: Fails badly
description: Fails badly
operationId: fakeapi.hello.internal_error
produces:
- text/plain
responses:
200:
description: goodbye response
schema:
type: string
/multimime:
get:
summary: Has multiple content types
description: Has multiple content types
operationId: fakeapi.hello.multimime
produces:
- application/json
- application/xml
responses:
200:
description: goodbye response
schema:
type: string
/empty:
get:
summary: Returns empty response
description: Returns empty response
operationId: fakeapi.hello.empty
produces:
- application/json
responses:
204:
description: empty
/test_schema:
post:
summary: Returns the image_version
description: Returns the image_version
operationId: fakeapi.hello.schema
parameters:
- name: new_stack
required: true
in: body
schema:
$ref: '#/definitions/new_stack'
produces:
- application/json
responses:
200:
description: goodbye response
schema:
$ref: '#/definitions/new_stack'
/test_schema/response/object/{valid}:
get:
summary: Returns an image_version as an object
description: Returns image_version
operationId: fakeapi.hello.schema_response_object
produces:
- application/json
parameters:
- name: valid
in: path
description: Whether to return a valid or invalid schema in the response body
required: true
type: string
responses:
200:
description: Requested new_stack data model
schema:
$ref: '#/definitions/new_stack'
/test_schema/response/string/{valid}:
get:
summary: Returns an image_version as a string
description: Returns image_version
operationId: fakeapi.hello.schema_response_string
produces:
- text/plain
parameters:
- name: valid
in: path
description: Whether to return a valid or invalid schema in the response body
required: true
type: string
responses:
200:
description: Requested new_stack data model
schema:
type: string
/test_schema/response/integer/{valid}:
get:
summary: Returns an image_version as an integer
description: Returns image_version
operationId: fakeapi.hello.schema_response_integer
produces:
- text/plain
parameters:
- name: valid
in: path
description: Whether to return a valid or invalid schema in the response body
required: true
type: string
responses:
200:
description: Requested new_stack data model
schema:
type: integer
/test_schema/response/number/{valid}:
get:
summary: Returns an image_version as a number(float)
description: Returns image_version
operationId: fakeapi.hello.schema_response_number
produces:
- text/plain
parameters:
- name: valid
in: path
description: Whether to return a valid or invalid schema in the response body
required: true
type: string
responses:
200:
description: Requested new_stack data model
schema:
type: number
/test_schema/response/boolean/{valid}:
get:
summary: Returns an image_version as a boolean
description: Returns image_version
operationId: fakeapi.hello.schema_response_boolean
produces:
- text/plain
parameters:
- name: valid
in: path
description: Whether to return a valid or invalid schema in the response body
required: true
type: string
responses:
200:
description: Requested new_stack data model
schema:
type: boolean
/test_schema/response/array/{valid}:
get:
summary: Returns an image_version as a boolean
description: Returns image_version
operationId: fakeapi.hello.schema_response_array
produces:
- application/json
parameters:
- name: valid
in: path
description: Whether to return a valid or invalid schema in the response body
required: true
type: string
responses:
200:
description: Requested new_stack data model
schema:
type: array
items:
schema:
$ref: '#/definitions/new_stack'
/test_schema_in_query:
post:
summary: Returns the image_version
description: Returns the image_version
operationId: fakeapi.hello.schema_query
parameters:
- name: image_version
required: true
in: query
type: string
- name: not_required
required: false
in: query
type: string
produces:
- application/json
responses:
200:
description: goodbye response
schema:
$ref: '#/definitions/new_stack'
/test_schema_list:
post:
summary: Returns empty response
description: Returns empty response
operationId: fakeapi.hello.schema_list
parameters:
- name: new_stack
required: true
in: body
schema:
type: array
items:
type: string
produces:
- application/json
responses:
200:
description: goodbye response
schema:
type: string
/test_schema_format:
post:
summary: Returns empty response
description: Returns empty response
operationId: fakeapi.hello.schema_format
parameters:
- name: timestamp
required: true
in: body
schema:
type: string
format: date-time
produces:
- application/json
responses:
200:
description: goodbye response
schema:
type: string
/test_not_implemented:
post:
summary: Returns empty response
description: Returns empty response
operationId: fakeapi.hello.test_not_implemented
parameters:
- name: new_stack
required: true
in: body
schema:
$ref: '#/definitions/new_stack'
produces:
- application/json
responses:
200:
description: goodbye response
schema:
type: string
/test_parameter_validation:
get:
operationId: fakeapi.hello.test_parameter_validation
parameters:
- name: date
in: query
type: string
format: date
- name: int
in: query
type: integer
- name: bool
in: query
type: boolean
/test_required_query_param:
get:
operationId: fakeapi.hello.test_required_query_param
parameters:
- name: n
in: query
type: number
required: true
/test_array_csv_query_param:
get:
operationId: fakeapi.hello.test_array_csv_query_param
parameters:
- name: items
in: query
description: An comma separated array of items
required: true
type: array
items:
type: string
collectionFormat: csv
/test_array_pipes_query_param:
get:
operationId: fakeapi.hello.test_array_pipes_query_param
parameters:
- name: items
in: query
description: An pipe separated array of items
required: true
type: array
items:
type: integer
collectionFormat: pipes
/test_array_unsupported_query_param:
get:
operationId: fakeapi.hello.test_array_unsupported_query_param
parameters:
- name: items
in: query
description: An pipe separated array of items
required: true
type: array
items:
type: string
collectionFormat: unsupported
/test_no_content_response:
get:
operationId: fakeapi.hello.test_no_content_response
responses:
204:
description: No content returned
/schema_array:
get:
tags:
description: test schema array
operationId: fakeapi.hello.test_schema_array
parameters:
- name: test_array
in: body
required: true
schema:
type: array
items:
type: string
responses:
200:
description: OK
/schema_int:
get:
tags:
description: test schema int
operationId: fakeapi.hello.test_schema_int
parameters:
- name: test_int
in: body
required: true
schema:
type: integer
responses:
200:
description: OK
/goodday/{name}:
post:
summary: Generate good day greeting
description: Generates a good day message.
headers:
Location:
type: string
description: The URI of the created resource
operationId: fakeapi.hello.post_goodday
responses:
201:
description: gooday response
headers:
Location:
type: string
description: The URI of the created resource
schema:
type: object
parameters:
- name: name
in: path
description: Name of the person to greet.
required: true
type: string
/goodday/noheader:
post:
summary: Generate good day greeting
description: Generates a good day message.
operationId: fakeapi.hello.post_goodday_no_header
responses:
201:
description: gooday response
headers:
Location:
type: string
description: The URI of the created resource
schema:
type: object
/goodevening/{name}:
post:
summary: Generate good evening
description: Generates a good evening message.
headers:
Location:
type: string
description: The URI of the created resource
operationId: fakeapi.hello.post_goodevening
produces:
- text/plain
responses:
201:
description: goodevening response
headers:
Location:
type: string
description: The URI of the created resource
schema:
type: string
parameters:
- name: name
in: path
description: Name of the person to say good evening.
required: true
type: string
/resolver-test/method:
get:
summary: Test class instance method
operationId: fakeapi.hello.class_instance.test_method
/resolver-test/classmethod:
get:
summary: Test class instance method
operationId: fakeapi.hello.DummyClass.test_classmethod
/test-int-path/{someint}:
get:
summary: Test type casting of path parameter
operationId: fakeapi.hello.test_get_someint
parameters:
- name: someint
in: path
type: integer
/test-float-path/{somefloat}:
get:
summary: Test type casting of path parameter
operationId: fakeapi.hello.test_get_somefloat
parameters:
- name: somefloat
in: path
type: number
/test-default-query-parameter:
get:
summary: Test if default parameter is passed to function
operationId: fakeapi.hello.test_default_param
parameters:
- name: name
in: query
type: string
default: connexion
/test-default-object-body:
post:
summary: Test if default object body param is passed to handler.
operationId: fakeapi.hello.test_default_object_body
parameters:
- name: stack
type: object
in: body
default:
'image_version': 'default_image'
schema:
$ref: '#/definitions/new_stack'
/test-default-integer-body:
post:
summary: Test if default integer body param is passed to handler.
operationId: fakeapi.hello.test_default_integer_body
parameters:
- name: stack_version
type: integer
in: body
default: 1
/test-falsy-param:
get:
summary: Test if default value when argument is falsy.
operationId: fakeapi.hello.test_falsy_param
parameters:
- name: falsy
type: integer
in: query
default: 1
/test-formData-param:
post:
summary: Test formData parameter
operationId: fakeapi.hello.test_formData_param
parameters:
- name: formData
type: string
in: formData
required: true
/test-formData-missing-param:
post:
summary: Test formData missing parameter in handler
operationId: fakeapi.hello.test_formData_missing_param
parameters:
- name: missing_formData
type: string
in: formData
required: true
/test-bool-param:
get:
summary: Test usage of boolean default value
operationId: fakeapi.hello.test_bool_default_param
parameters:
- name: thruthiness
type: boolean
in: query
default: false
/test-required-param:
get:
summary: Test required param without default value
operationId: fakeapi.hello.test_required_param
parameters:
- name: simple
type: string
in: query
required: true
definitions:
new_stack:
type: object
properties:
image_version:
type: string
description: Docker image version to deploy
required:
- image_version