From 836eeea14c09115ac62abe6a5e93cd614a8c630b Mon Sep 17 00:00:00 2001 From: Alexander Kavanaugh Date: Fri, 2 Oct 2020 10:39:15 -0700 Subject: [PATCH] https://github.com/axnsan12/drf-yasg/pull/499/ --- src/drf_yasg/inspectors/view.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/drf_yasg/inspectors/view.py b/src/drf_yasg/inspectors/view.py index 334c274a..3aaab06b 100644 --- a/src/drf_yasg/inspectors/view.py +++ b/src/drf_yasg/inspectors/view.py @@ -264,9 +264,14 @@ def get_response_schemas(self, response_serializers): ) else: serializer = force_serializer_instance(serializer) + schema = self.serializer_to_schema(serializer) + + 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