...
1swagger: '2.0'
2info:
3 title: code generation test fixture for parameters, with default values
4 version: '1.0.0'
5host: localhost
6basePath: /
7consumes:
8 - application/json
9produces:
10 - application/json
11schemes:
12 - http
13paths:
14 /required/params:
15 get:
16 operationId: getRequired
17 parameters:
18 - name: notAnOption1
19 in: query
20 type: string
21 format: date
22 required: true
23 - name: notAnOption2
24 in: query
25 type: string
26 format: password
27 pattern: '^[a-z]$'
28 required: true
29 - name: notAnOption3
30 in: query
31 type: integer
32 format: int32
33 required: true
34 - name: notAnOption4
35 in: query
36 type: integer
37 format: int32
38 required: true
39 minimum: 10
40 maximum: 100
41 multipleOf: 10
42 - name: notAnOption5
43 in: query
44 type: array
45 required: true
46 maxItems: 2
47 items:
48 type: string
49 format: uuid
50 - name: notAnOption6
51 in: query
52 type: array
53 collectionFormat: pipes
54 required: true
55 uniqueItems: true
56 items:
57 type: integer
58 format: int32
59 minimum: 10
60 maximum: 100
61 multipleOf: 10
62 - name: notAnOption7
63 in: query
64 type: array
65 collectionFormat: pipes
66 required: true
67 uniqueItems: false
68 items:
69 type: array
70 collectionFormat: csv
71 uniqueItems: true
72 items:
73 type: string
74 format: date
75 responses: &stdResponses
76 200:
77 description: simple type
78 schema:
79 type: string
80 format: date
81 201:
82 description: simple type
83 schema:
84 type: string
85 format: uuid
86 default:
87 description: schema type
88 schema:
89 $ref: '#/definitions/ContainerConfig'
90 /optional/params:
91 get:
92 operationId: getOptional
93 parameters:
94 - name: sanityCheck1
95 in: query
96 type: string
97 required: false
98 default: sanity check one passed for primitive type
99 - name: sanityCheck2
100 in: query
101 type: number
102 required: false
103 default: 99.9
104 - name: sanityCheck3
105 in: query
106 type: integer
107 required: false
108 default: 1000
109 - name: sanityCheck4
110 in: query
111 type: integer
112 format: uint32
113 required: false
114 default: 100
115 - name: sanityCheckFormat1
116 in: query
117 type: string
118 format: uuid
119 required: false
120 default: a8098c1a-f86e-11da-bd1a-00112444be1e
121 - name: isAnOption1
122 in: query
123 type: string
124 format: date
125 required: false
126 default: '1970-01-01'
127 - name: isAnOption2
128 in: query
129 type: string
130 format: password
131 pattern: '^[a-z]$'
132 required: false
133 default: z
134 - name: isAnOption3
135 in: query
136 type: integer
137 format: int32
138 required: false
139 default: 32
140 - name: isAnOption4
141 in: query
142 type: integer
143 format: int32
144 required: false
145 minimum: 10
146 maximum: 100
147 multipleOf: 10
148 default: 60
149 - name: isAnOption5
150 in: query
151 type: array
152 maxItems: 2
153 items:
154 type: string
155 format: uuid
156 default:
157 - a8098c1a-f86e-11da-bd1a-00112444be1e
158 - name: isAnOption6
159 in: query
160 type: array
161 collectionFormat: pipes
162 required: false
163 items:
164 type: integer
165 format: int32
166 minimum: 10
167 maximum: 100
168 multipleOf: 10
169 default:
170 - 10
171 - 20
172 - 30
173 - 40
174 - name: isAnOption7
175 in: query
176 type: array
177 collectionFormat: pipes
178 required: false
179 items:
180 type: array
181 collectionFormat: csv
182 items:
183 type: string
184 format: date
185 default:
186 - '2018-01-01'
187 - '2018-01-02'
188 - '2018-01-03'
189 - '2018-01-04'
190 default:
191 -
192 - '2012-01-01'
193 - '2014-01-02'
194 - '2016-01-03'
195 - '2018-01-04'
196 -
197 - '2011-01-01'
198 - '2013-01-02'
199 - '2015-01-03'
200 - '2017-01-04'
201 - name: isAnOption8
202 in: query
203 type: array
204 maxItems: 2
205 uniqueItems: true
206 items:
207 type: string
208 default:
209 - default unformatted string array item 1
210 - default unformatted string array item 2
211 - name: isAnOption9
212 in: query
213 type: array
214 collectionFormat: pipes
215 required: false
216 items:
217 type: array
218 collectionFormat: csv
219 items:
220 type: string
221 format: duration
222 default:
223 - 1d
224 - 1w
225 - 1h
226 - 2w
227 default:
228 -
229 - 1s
230 - 1h
231 - 1d
232 - 1w
233 -
234 - 2s
235 - 2h
236 - 2d
237 - 2w
238 responses: *stdResponses
239 /path/params/{notAnOption1}/{notAnOption2}/{notAnOption3}/{notAnOption4}/{notAnOption5}/{notAnOption6}/{notAnOption7}:
240 get:
241 operationId: getRequiredInPath
242 parameters:
243 - name: notAnOption1
244 in: path
245 type: string
246 format: date
247 required: true
248 - name: notAnOption2
249 in: path
250 type: string
251 format: password
252 pattern: '^[a-z]$'
253 required: true
254 - name: notAnOption3
255 in: path
256 type: integer
257 format: int32
258 required: true
259 - name: notAnOption4
260 in: path
261 type: integer
262 format: int32
263 required: true
264 minimum: 10
265 maximum: 100
266 multipleOf: 10
267 - name: notAnOption5
268 in: path
269 type: array
270 maxItems: 2
271 required: true
272 items:
273 type: string
274 format: uuid
275 - name: notAnOption6
276 in: path
277 type: array
278 collectionFormat: pipes
279 required: true
280 items:
281 type: integer
282 format: int32
283 minimum: 10
284 maximum: 100
285 multipleOf: 10
286 - name: notAnOption7
287 in: path
288 type: array
289 collectionFormat: pipes
290 required: true
291 items:
292 type: array
293 collectionFormat: csv
294 items:
295 type: string
296 format: date
297 responses: *stdResponses
298 /optional/headers:
299 get:
300 operationId: getInHeaders
301 parameters:
302 - name: isAnOption1
303 in: header
304 type: string
305 format: date
306 required: false
307 default: '1970-01-01'
308 - name: isAnOption2
309 in: header
310 type: string
311 format: password
312 pattern: '^[a-z]$'
313 required: false
314 default: z
315 - name: isAnOption3
316 in: header
317 type: integer
318 format: int32
319 required: false
320 default: 32
321 - name: isAnOption4
322 in: header
323 type: integer
324 format: int32
325 required: false
326 minimum: 10
327 maximum: 100
328 multipleOf: 10
329 default: 60
330 - name: isAnOption5
331 in: header
332 type: array
333 maxItems: 2
334 items:
335 type: string
336 format: uuid
337 default:
338 - a8098c1a-f86e-11da-bd1a-00112444be1e
339 - name: isAnOption6
340 in: header
341 type: array
342 collectionFormat: pipes
343 required: false
344 items:
345 type: integer
346 format: int32
347 minimum: 10
348 maximum: 100
349 multipleOf: 10
350 default:
351 - 10
352 - 20
353 - 30
354 - 40
355 - name: isAnOption7
356 in: header
357 type: array
358 collectionFormat: pipes
359 required: false
360 items:
361 type: array
362 collectionFormat: csv
363 items:
364 type: string
365 format: date
366 default:
367 - '2018-01-01'
368 - '2018-01-02'
369 - '2018-01-03'
370 - '2018-01-04'
371 default:
372 -
373 - '2012-01-01'
374 - '2014-01-02'
375 - '2016-01-03'
376 - '2018-01-04'
377 -
378 - '2011-01-01'
379 - '2013-01-02'
380 - '2015-01-03'
381 - '2017-01-04'
382 responses: *stdResponses
383 /mixed/deepnested:
384 get:
385 operationId: getInDepth
386 parameters:
387 - name: deepNested1
388 in: query
389 type: array
390 collectionFormat: pipes
391 required: true
392 maxItems: 2
393 items:
394 type: array
395 collectionFormat: csv
396 minItems: 2
397 items:
398 type: array
399 collectionFormat: ssv
400 uniqueItems: true
401 items:
402 type: string
403 pattern: '^[a-z]$'
404 default:
405 - a
406 - b
407 - c
408 default:
409 -
410 - x
411 - 'y'
412 - z
413 -
414 - u
415 - v
416 - w
417 default:
418 -
419 -
420 - h
421 - i
422 - j
423 -
424 - k
425 - l
426 - m
427 -
428 -
429 - h
430 - i
431 - j
432 -
433 - k
434 - l
435 - m
436 - name: deepNested2
437 in: header
438 type: array
439 collectionFormat: pipes
440 required: false
441 maxItems: 2
442 items:
443 type: array
444 collectionFormat: csv
445 minItems: 2
446 items:
447 type: array
448 collectionFormat: ssv
449 uniqueItems: true
450 items:
451 type: string
452 pattern: '^[a-z]$'
453 default:
454 - a
455 - b
456 - c
457 default:
458 -
459 - x
460 - 'y'
461 - z
462 -
463 - u
464 - v
465 - w
466 default:
467 -
468 -
469 - h
470 - i
471 - j
472 -
473 - k
474 - l
475 - m
476 -
477 -
478 - h
479 - i
480 - j
481 -
482 - k
483 - l
484 - m
485 responses: *stdResponses
486 /mixed/mixedBody/{pathParam1}:
487 post:
488 operationId: getInBody
489 parameters:
490 - name: bodyBuilding
491 in: body
492 schema:
493 $ref: '#/definitions/ContainerConfig'
494 - name: queryParam1
495 in: query
496 type: integer
497 required: false
498 allowEmptyValue: true
499 default: 100
500 maximum: 1000
501 - name: queryParam2
502 in: query
503 type: string
504 format: date
505 required: false
506 default: '1970-01-01'
507 - name: queryParam3
508 in: query
509 type: integer
510 format: uint32
511 minimum: 12
512 exclusiveMinimum: true
513 allowEmptyValue: true
514 required: true
515 - name: queryParam4
516 in: query
517 collectionFormat: multi
518 maxItems: 2
519 type: array
520 items:
521 type: string
522 format: uuid
523 default:
524 - a8098c1a-f86e-11da-bd1a-00112444be1e
525 - a8098c1a-f86e-11da-bd1a-00112444be1e
526 - name: query_issue_863
527 in: query
528 type: array
529 items:
530 type: string
531 enum:
532 - enum1
533 - enum2
534 - enum3
535 - name: pathParam1
536 in: path
537 type: string
538 pattern: '^\w+$'
539 required: true
540 - name: headerParam1
541 in: header
542 type: array
543 items:
544 type: number
545 default:
546 - 1.1
547 - 2.75
548 required: false
549 responses: *stdResponses
550
551 /mixed/mixedBody2/{pathParam1}:
552 post:
553 operationId: getInBody2
554 parameters:
555 - name: bodyBuilding
556 in: body
557 required: true
558 schema:
559 $ref: '#/definitions/errorResponseMsg'
560 - name: queryParam1
561 in: query
562 type: integer
563 required: false
564 allowEmptyValue: true
565 default: 100
566 maximum: 1000
567 - name: queryParam2
568 in: query
569 type: string
570 format: date
571 required: true
572 default: '1970-01-01'
573 - name: queryParam3
574 in: query
575 type: integer
576 format: uint32
577 minimum: 12
578 exclusiveMinimum: true
579 allowEmptyValue: true
580 required: true
581 - name: queryParam4
582 in: query
583 collectionFormat: multi
584 maxItems: 2
585 type: array
586 items:
587 type: string
588 format: uuid
589 default:
590 - a8098c1a-f86e-11da-bd1a-00112444be1e
591 - name: pathParam1
592 in: path
593 type: string
594 pattern: '^\w+$'
595 required: true
596 - name: headerParam1
597 in: header
598 type: array
599 items:
600 type: number
601 default:
602 - 1.1
603 - 2.75
604 required: false
605 responses: *stdResponses
606
607 /mixed/mixedBody3/{pathParam1}:
608 post:
609 operationId: getInBody3
610 parameters:
611 - name: bodyBuilding
612 in: body
613 required: false
614 schema:
615 $ref: '#/definitions/errorResponseMsg'
616 - name: queryParam1
617 in: query
618 type: integer
619 required: false
620 allowEmptyValue: true
621 default: 100
622 maximum: 1000
623 - name: queryParam2
624 in: query
625 type: string
626 format: date
627 required: true
628 default: '1970-01-01'
629 - name: queryParam3
630 in: query
631 type: integer
632 format: uint32
633 minimum: 12
634 exclusiveMinimum: true
635 allowEmptyValue: true
636 required: true
637 - name: queryParam4
638 in: query
639 collectionFormat: multi
640 maxItems: 2
641 type: array
642 items:
643 type: string
644 format: uuid
645 default:
646 - a8098c1a-f86e-11da-bd1a-00112444be1e
647 - name: pathParam1
648 in: path
649 type: string
650 pattern: '^\w+$'
651 required: true
652 - name: headerParam1
653 in: header
654 type: array
655 items:
656 type: number
657 default:
658 - 1.1
659 - 2.75
660 required: false
661 responses: *stdResponses
662 /form/{pathParam1}:
663 post:
664 operationId: getInForm
665 consumes:
666 - multipart/formData
667 parameters:
668 - name: pathParam1
669 in: path
670 type: string
671 maxLength: 10
672 required: true
673 - name: docname
674 in: formData
675 type: string
676 pattern: '^\w+\.doc$'
677 required: true
678 - name: docAuthor
679 in: formData
680 type: string
681 - name: attachment
682 in: formData
683 type: file
684 required: true
685 - name: addendum
686 in: formData
687 type: file
688 required: false
689 responses: *stdResponses
690
691definitions:
692 ContainerConfig:
693 type: object
694 required: [config1]
695 properties:
696 config1:
697 type: string
698 format: date
699 config2:
700 type: string
701 format: date
702 default: '1999-09-09'
703 default:
704 config1: '2019-09-09'
705 config2: '2018-09-09'
706 errorResponseMsg:
707 type: object
708 required: [ errorCode, reason ]
709 properties:
710 errorCode:
711 type: integer
712 reason:
713 type: string
714 severity:
715 type: string
716 enum: [ FATAL, CRITICAL, ERROR, WARNING, INFO ]
717 additional:
718 type: string
719 enum: [ FATAL, CRITICAL, ERROR, WARNING, INFO ]
720 default: INFO
721 default:
722 errorCode: 501
723 reason: not implemented
724 severity: FATAL
View as plain text