@@ -90,7 +90,6 @@ def app
90
90
'title' => 'API title' , 'version' => '0.0.1'
91
91
} ,
92
92
'openapi' => '3.0.0' ,
93
- # 'produces' => ['application/xml', 'application/json', 'application/octet-stream', 'text/plain'],
94
93
'servers' => [
95
94
'url' => 'http://example.org'
96
95
] ,
@@ -107,66 +106,59 @@ def app
107
106
'/' => {
108
107
'get' => {
109
108
'description' => 'Document root' ,
110
- 'produces' => [ 'application/json' ] ,
111
- 'responses' => { '200' => { 'description' => 'Document root' } } ,
109
+ 'responses' => { '200' => { 'content' => { 'application/json' => { } } , 'description' => 'Document root' } } ,
112
110
'operationId' => 'get'
113
111
}
114
112
} ,
115
113
'/simple' => {
116
114
'get' => {
117
115
'description' => 'This gets something.' ,
118
- 'produces' => [ 'application/json' ] ,
119
116
'tags' => [ 'simple' ] ,
120
117
'operationId' => 'getSimple' ,
121
- 'responses' => { '200' => { 'description' => 'This gets something.' } }
118
+ 'responses' => { '200' => { 'content' => { 'application/json' => { } } , ' description' => 'This gets something.' } }
122
119
}
123
120
} ,
124
121
'/simple-test' => {
125
122
'get' => {
126
123
'description' => 'This gets something for URL using - separator.' ,
127
- 'produces' => [ 'application/json' ] ,
128
124
'tags' => [ 'simple-test' ] ,
129
125
'operationId' => 'getSimpleTest' ,
130
- 'responses' => { '200' => { 'description' => 'This gets something for URL using - separator.' } }
126
+ 'responses' => { '200' => { 'content' => { 'application/json' => { } } , ' description' => 'This gets something for URL using - separator.' } }
131
127
}
132
128
} ,
133
129
'/simple-head-test' => {
134
130
'head' => {
135
- 'produces' => [ 'application/json' ] ,
136
- 'responses' => { '200' => { 'description' => 'head SimpleHeadTest' } } ,
131
+ 'responses' => { '200' => { 'content' => { 'application/json' => { } } , 'description' => 'head SimpleHeadTest' } } ,
137
132
'tags' => [ 'simple-head-test' ] ,
138
133
'operationId' => 'headSimpleHeadTest'
139
134
}
140
135
} ,
141
136
'/simple-options-test' => {
142
137
'options' => {
143
- 'produces' => [ 'application/json' ] ,
144
- 'responses' => { '200' => { 'description' => 'option SimpleOptionsTest' } } ,
138
+ 'responses' => { '200' => { 'content' => { 'application/json' => { } } , 'description' => 'option SimpleOptionsTest' } } ,
145
139
'tags' => [ 'simple-options-test' ] ,
146
140
'operationId' => 'optionsSimpleOptionsTest'
147
141
}
148
142
} ,
149
143
'/simple_with_headers' => {
150
144
'get' => {
151
145
'description' => 'this gets something else' ,
152
- 'produces' => [ 'application/json' ] ,
153
146
'parameters' => [
154
147
{ 'in' => 'header' , 'name' => 'XAuthToken' , 'description' => 'A required header.' , 'type' => 'string' , 'required' => true } ,
155
148
{ 'in' => 'header' , 'name' => 'XOtherHeader' , 'description' => 'An optional header.' , 'type' => 'string' , 'required' => false }
156
149
] ,
157
150
'tags' => [ 'simple_with_headers' ] ,
158
151
'operationId' => 'getSimpleWithHeaders' ,
159
152
'responses' => {
160
- '200' => { 'description' => 'this gets something else' } ,
161
- '403' => { 'description' => 'invalid pony' } ,
162
- '405' => { 'description' => 'no ponies left!' }
153
+ '200' => { 'content' => { 'application/json' => { } } , ' description' => 'this gets something else' } ,
154
+ '403' => { 'content' => { 'application/json' => { } } , ' description' => 'invalid pony' } ,
155
+ '405' => { 'content' => { 'application/json' => { } } , ' description' => 'no ponies left!' }
163
156
}
164
157
}
165
158
} ,
166
159
'/items' => {
167
160
'post' => {
168
161
'description' => 'this takes an array of parameters' ,
169
- 'produces' => [ 'application/json' ] ,
170
162
'consumes' => [ 'application/json' ] ,
171
163
'parameters' => [ { 'in' => 'formData' , 'name' => 'items[]' , 'description' => 'array of items' , 'required' => false , 'type' => 'array' , 'items' => { 'type' => 'string' } } ] ,
172
164
'tags' => [ 'items' ] ,
@@ -177,11 +169,10 @@ def app
177
169
'/custom' => {
178
170
'get' => {
179
171
'description' => 'this uses a custom parameter' ,
180
- 'produces' => [ 'application/json' ] ,
181
172
'parameters' => [ { 'in' => 'formData' , 'name' => 'custom' , 'description' => 'array of items' , 'required' => false , 'type' => 'array' , 'items' => { 'type' => 'CustomType' } } ] ,
182
173
'tags' => [ 'custom' ] ,
183
174
'operationId' => 'getCustom' ,
184
- 'responses' => { '200' => { 'description' => 'this uses a custom parameter' } }
175
+ 'responses' => { '200' => { 'content' => { 'application/json' => { } } , ' description' => 'this uses a custom parameter' } }
185
176
}
186
177
}
187
178
}
@@ -210,10 +201,9 @@ def app
210
201
'/simple' => {
211
202
'get' => {
212
203
'description' => 'This gets something.' ,
213
- 'produces' => [ 'application/json' ] ,
214
204
'tags' => [ 'simple' ] ,
215
205
'operationId' => 'getSimple' ,
216
- 'responses' => { '200' => { 'description' => 'This gets something.' } }
206
+ 'responses' => { '200' => { 'content' => { 'application/json' => { } } , ' description' => 'This gets something.' } }
217
207
}
218
208
}
219
209
}
@@ -234,7 +224,7 @@ def app
234
224
'openapi' => '3.0.0' ,
235
225
# 'produces' => ['application/xml', 'application/json', 'application/octet-stream', 'text/plain'],
236
226
'servers' => [
237
- 'url' => 'http://example.org'
227
+ 'url' => 'http://example.org'
238
228
] ,
239
229
'tags' => [
240
230
{ 'name' => 'simple-test' , 'description' => 'Operations about simple-tests' }
@@ -243,10 +233,9 @@ def app
243
233
'/simple-test' => {
244
234
'get' => {
245
235
'description' => 'This gets something for URL using - separator.' ,
246
- 'produces' => [ 'application/json' ] ,
247
236
'tags' => [ 'simple-test' ] ,
248
237
'operationId' => 'getSimpleTest' ,
249
- 'responses' => { '200' => { 'description' => 'This gets something for URL using - separator.' } }
238
+ 'responses' => { '200' => { 'content' => { 'application/json' => { } } , ' description' => 'This gets something for URL using - separator.' } }
250
239
}
251
240
}
252
241
}
@@ -265,17 +254,16 @@ def app
265
254
'/simple_with_headers' => {
266
255
'get' => {
267
256
'description' => 'this gets something else' ,
268
- 'produces' => [ 'application/json' ] ,
269
257
'parameters' => [
270
258
{ 'in' => 'header' , 'name' => 'XAuthToken' , 'description' => 'A required header.' , 'type' => 'string' , 'required' => true } ,
271
259
{ 'in' => 'header' , 'name' => 'XOtherHeader' , 'description' => 'An optional header.' , 'type' => 'string' , 'required' => false }
272
260
] ,
273
261
'tags' => [ 'simple_with_headers' ] ,
274
262
'operationId' => 'getSimpleWithHeaders' ,
275
263
'responses' => {
276
- '200' => { 'description' => 'this gets something else' } ,
277
- '403' => { 'description' => 'invalid pony' } ,
278
- '405' => { 'description' => 'no ponies left!' }
264
+ '200' => { 'content' => { 'application/json' => { } } , ' description' => 'this gets something else' } ,
265
+ '403' => { 'content' => { 'application/json' => { } } , ' description' => 'invalid pony' } ,
266
+ '405' => { 'content' => { 'application/json' => { } } , ' description' => 'no ponies left!' }
279
267
}
280
268
}
281
269
}
@@ -294,7 +282,6 @@ def app
294
282
'/items' => {
295
283
'post' => {
296
284
'description' => 'this takes an array of parameters' ,
297
- 'produces' => [ 'application/json' ] ,
298
285
'consumes' => [ 'application/json' ] ,
299
286
'parameters' => [ { 'in' => 'formData' , 'name' => 'items[]' , 'description' => 'array of items' , 'required' => false , 'type' => 'array' , 'items' => { 'type' => 'string' } } ] ,
300
287
'tags' => [ 'items' ] ,
@@ -317,11 +304,10 @@ def app
317
304
'/custom' => {
318
305
'get' => {
319
306
'description' => 'this uses a custom parameter' ,
320
- 'produces' => [ 'application/json' ] ,
321
307
'parameters' => [ { 'in' => 'formData' , 'name' => 'custom' , 'description' => 'array of items' , 'required' => false , 'type' => 'array' , 'items' => { 'type' => 'CustomType' } } ] ,
322
308
'tags' => [ 'custom' ] ,
323
309
'operationId' => 'getCustom' ,
324
- 'responses' => { '200' => { 'description' => 'this uses a custom parameter' } }
310
+ 'responses' => { '200' => { 'content' => { 'application/json' => { } } , ' description' => 'this uses a custom parameter' } }
325
311
}
326
312
}
327
313
)
0 commit comments