OpenAPI: Use _get_serializer() in _get_operation_id() (#7160)

This commit is contained in:
Fábio Domingues 2020-01-26 18:13:08 +00:00 committed by Carlton Gibson
parent e4a26ad58a
commit d22daf4e05

View File

@ -117,8 +117,8 @@ class AutoSchema(ViewInspector):
name = model.__name__ name = model.__name__
# Try with the serializer class name # Try with the serializer class name
elif hasattr(self.view, 'get_serializer_class'): elif self._get_serializer(path, method) is not None:
name = self.view.get_serializer_class().__name__ name = self._get_serializer(path, method).__class__.__name__
if name.endswith('Serializer'): if name.endswith('Serializer'):
name = name[:-10] name = name[:-10]