mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
OpenAPI: Use _get_serializer() in _get_operation_id() (#7160)
This commit is contained in:
parent
e4a26ad58a
commit
d22daf4e05
|
@ -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]
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user