...
1swagger: '2.0'
2info:
3 title: additionalItems
4 version: '1.0'
5 description: this spec exercise the additionalItems property on params and responses, with default and example values. This one is valid.
6 license:
7 name: MIT
8host: localhost:8081
9basePath: /api/v1
10schemes:
11 - http
12consumes:
13 - application/json
14produces:
15 - application/json
16paths:
17 /servers/getSomeIds:
18 get:
19 operationId: getSomeIdsOps
20 parameters:
21 - name: addItems1
22 in: body
23 schema:
24 type: object
25 # Irrelevant: success
26 #additionalItems: true
27 properties:
28 id:
29 type: string
30 default: 'abc'
31 example: 'def'
32 - name: addItems2
33 in: query
34 schema:
35 type: array
36 # Irrelevant: success
37 #additionalItems: false
38 items:
39 id:
40 type: string
41 default: 'abc'
42 example: 'def'
43 - name: addItems3
44 in: query
45 schema:
46 type: array
47 # Irrelevant: success
48 #additionalItems: false
49 items:
50 id:
51 type: number
52 default: 1
53 example: 123
54 - name: addItems4
55 in: query
56 schema:
57 type: array
58 # Applies: success
59 #additionalItems: false
60 #minItems: 1
61 #maxItems: 2
62 #uniqueItems: true
63 items:
64 - $ref: '#/definitions/itemsSchema1'
65 - $ref: '#/definitions/itemsSchema2'
66 - $ref: '#/definitions/itemsSchema3'
67 default:
68 - x: 'a'
69 y: 1
70 - t: 1
71 example:
72 - x: 'a'
73 y: 1
74 - z: 1
75 responses:
76 '200':
77definitions:
78 itemsSchema1:
79 type: object
80 required:
81 - x
82 - y
83 properties:
84 x:
85 type: string
86 enum:
87 - 'a'
88 - 'b'
89 - 'c'
90 default: 'a'
91 example: 'b'
92 y:
93 type: number
94 default: 1
95 example: 9
96 example:
97 x: 'c'
98 y: 12
99 itemsSchema2:
100 type: object
101 required:
102 - z
103 properties:
104 z:
105 type: number
106 default: 1
107 example: 9
108 example:
109 z: 12
110 itemsSchema3:
111 type: object
112 required:
113 - t
114 properties:
115 t:
116 type: number
117 default: 1
118 example: 9
119 example:
120 t: 12
View as plain text