From 34b64104eaaa9dee73d1dca73a0774f6e2456365 Mon Sep 17 00:00:00 2001 From: Alexander Kavanaugh Date: Fri, 2 Oct 2020 11:10:57 -0700 Subject: [PATCH] Updated get_response_schemas to work with latest code https://github.com/axnsan12/drf-yasg/pull/499 --- src/drf_yasg/inspectors/view.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/drf_yasg/inspectors/view.py b/src/drf_yasg/inspectors/view.py index 3aaab06b..56149cc5 100644 --- a/src/drf_yasg/inspectors/view.py +++ b/src/drf_yasg/inspectors/view.py @@ -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,