From 51bd7df76b7090ad10c4d5f5afb6977e84c52275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Domingues?= Date: Fri, 24 Jan 2020 14:30:37 +0000 Subject: [PATCH] Use _get_serializer() in _get_operation_id() --- rest_framework/schemas/openapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index 3a7eb29a7..351174aac 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -117,8 +117,8 @@ class AutoSchema(ViewInspector): name = model.__name__ # Try with the serializer class name - elif hasattr(self.view, 'get_serializer_class'): - name = self.view.get_serializer_class().__name__ + elif self._get_serializer(path, method) is not None: + name = self._get_serializer(path, method).__class__.__name__ if name.endswith('Serializer'): name = name[:-10]