Skip to content

Commit

Permalink
Fix extend schema with pagination for actions with customized respons…
Browse files Browse the repository at this point in the history
…es/serializers.
  • Loading branch information
groshev41273m committed May 25, 2021
1 parent b99306f commit d20c44a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/drf_yasg/inspectors/view.py
Expand Up @@ -264,9 +264,18 @@ def get_response_schemas(self, response_serializers):
)
else:
serializer = force_serializer_instance(serializer)

schema = self.serializer_to_schema(serializer)

if self.has_list_response():
schema = openapi.Schema(type=openapi.TYPE_ARRAY,
items=schema)
if self.should_page():
schema = self.get_paginated_response(schema) or schema

response = openapi.Response(
description='',
schema=self.serializer_to_schema(serializer),
schema=schema,
)

responses[str(sc)] = response
Expand Down

1 comment on commit d20c44a

@tuenut
Copy link

@tuenut tuenut commented on d20c44a Jul 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relates with #575

Please sign in to comment.