@@ -181,27 +181,28 @@ def get_apispec(cls):
181
181
}
182
182
},
183
183
"responses" : {
184
+ # Responses like images must be added as 200 responses with cls.responses = {200: {...}}
184
185
200 : {
185
- # Allow customising 200 (immediate response) content type
186
- "content_type" : cls .response_content_type ,
187
186
"description" : "Action completed immediately" ,
188
- ** (
189
- # If an action JSON schema is defined, set the response schema
190
- {"schema" : action_json_schema }
191
- if (action_json_schema )
192
- else {}
193
- ),
187
+ # Allow customising 200 (immediate response) content type
188
+ "content" : {
189
+ cls .response_content_type : (
190
+ {"schema" : action_json_schema }
191
+ if action_json_schema
192
+ else {}
193
+ )
194
+ },
194
195
},
195
- # Our POST 201 MUST be application/json
196
- # Responses like images must be added as 200 responses with cls.responses = {200: {...}}
197
196
201 : {
198
- "content_type" : "application/json" ,
199
197
"description" : "Action started" ,
200
- ** (
201
- {"schema" : action_json_schema }
202
- if action_json_schema
203
- else {}
204
- ),
198
+ # Our POST 201 MUST be application/json
199
+ "content" : {
200
+ "application/json" : (
201
+ {"schema" : action_json_schema }
202
+ if action_json_schema
203
+ else {}
204
+ )
205
+ },
205
206
},
206
207
},
207
208
},
@@ -210,12 +211,14 @@ def get_apispec(cls):
210
211
# Our GET 200 MUST be application/json
211
212
200 : {
212
213
"content_type" : "application/json" ,
213
- "description" : "Action started" ,
214
- ** (
215
- {"schema" : queue_json_schema }
216
- if queue_json_schema
217
- else {}
218
- ),
214
+ "description" : "Action queue" ,
215
+ "content" : {
216
+ "application/json" : (
217
+ {"schema" : queue_json_schema }
218
+ if queue_json_schema
219
+ else {}
220
+ )
221
+ },
219
222
}
220
223
},
221
224
},
@@ -304,13 +307,14 @@ def get_apispec(cls):
304
307
},
305
308
"responses" : {
306
309
200 : {
307
- "content_type" : cls .content_type ,
310
+ "content" : {
311
+ cls .content_type : (
312
+ {"schema" : class_json_schema }
313
+ if class_json_schema
314
+ else {}
315
+ )
316
+ },
308
317
"description" : "Write property" ,
309
- ** (
310
- {"schema" : class_json_schema }
311
- if class_json_schema
312
- else {}
313
- ),
314
318
}
315
319
},
316
320
},
@@ -323,13 +327,14 @@ def get_apispec(cls):
323
327
{
324
328
"responses" : {
325
329
200 : {
326
- "content_type" : "application/json" ,
330
+ "content" : {
331
+ cls .content_type : (
332
+ {"schema" : class_json_schema }
333
+ if class_json_schema
334
+ else {}
335
+ )
336
+ },
327
337
"description" : "Read property" ,
328
- ** (
329
- {"schema" : class_json_schema }
330
- if class_json_schema
331
- else {}
332
- ),
333
338
}
334
339
},
335
340
},
0 commit comments