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):
256256 response = serializer
257257 if hasattr (response , 'schema' ) and not isinstance (response .schema , openapi .Schema .OR_REF ):
258258 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
260266 elif isinstance (serializer , openapi .Schema .OR_REF ):
261267 response = openapi .Response (
262268 description = '' ,
@@ -266,9 +272,15 @@ def get_response_schemas(self, response_serializers):
266272 response = serializer
267273 else :
268274 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
269281 response = openapi .Response (
270282 description = '' ,
271- schema = self . serializer_to_schema ( serializer ) ,
283+ schema = schema ,
272284 )
273285
274286 responses [str (sc )] = response
You can’t perform that action at this time.
0 commit comments