File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,13 @@ def get_response_schemas(self, response_serializers):
256
256
response = serializer
257
257
if hasattr (response , 'schema' ) and not isinstance (response .schema , openapi .Schema .OR_REF ):
258
258
serializer = force_serializer_instance (response .schema )
259
- response .schema = self .serializer_to_schema (serializer )
259
+ schema = self .serializer_to_schema (serializer )
260
+ if self .has_list_response ():
261
+ schema = openapi .Schema (type = openapi .TYPE_ARRAY , items = schema )
262
+
263
+ if self .should_page ():
264
+ schema = self .get_paginated_response (schema ) or schema
265
+ response .schema = schema
260
266
elif isinstance (serializer , openapi .Schema .OR_REF ):
261
267
response = openapi .Response (
262
268
description = '' ,
@@ -266,9 +272,15 @@ def get_response_schemas(self, response_serializers):
266
272
response = serializer
267
273
else :
268
274
serializer = force_serializer_instance (serializer )
275
+ schema = self .serializer_to_schema (serializer )
276
+ if self .has_list_response ():
277
+ schema = openapi .Schema (type = openapi .TYPE_ARRAY , items = schema )
278
+
279
+ if self .should_page ():
280
+ schema = self .get_paginated_response (schema ) or schema
269
281
response = openapi .Response (
270
282
description = '' ,
271
- schema = self . serializer_to_schema ( serializer ) ,
283
+ schema = schema ,
272
284
)
273
285
274
286
responses [str (sc )] = response
You can’t perform that action at this time.
0 commit comments