Skip to content

Commit

Permalink
Updated get_response_schemas to work with latest code
Browse files Browse the repository at this point in the history
  • Loading branch information
kavdev committed Feb 25, 2021
1 parent 836eeea commit 50c578e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/drf_yasg/inspectors/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,13 @@ 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=schema,
Expand Down

0 comments on commit 50c578e

Please sign in to comment.