mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 08:59:54 +03:00
fix(openapi): remove duplicatde __init__
This commit is contained in:
parent
03d3406734
commit
c87837b025
|
@ -71,10 +71,14 @@ class SchemaGenerator(BaseSchemaGenerator):
|
||||||
|
|
||||||
class AutoSchema(ViewInspector):
|
class AutoSchema(ViewInspector):
|
||||||
|
|
||||||
def __init__(self, tags=None):
|
def __init__(self, operation_id_base=None, tags=None):
|
||||||
|
"""
|
||||||
|
:param operation_id_base: user-defined name in operationId. If empty, it will be deducted from the Model/Serializer/View name.
|
||||||
|
"""
|
||||||
if tags and not all(isinstance(tag, str) for tag in tags):
|
if tags and not all(isinstance(tag, str) for tag in tags):
|
||||||
raise ValueError('tags must be a list or tuple of string.')
|
raise ValueError('tags must be a list or tuple of string.')
|
||||||
self._tags = tags
|
self._tags = tags
|
||||||
|
self.operation_id_base = operation_id_base
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
request_media_types = []
|
request_media_types = []
|
||||||
|
@ -88,13 +92,6 @@ class AutoSchema(ViewInspector):
|
||||||
'delete': 'Destroy',
|
'delete': 'Destroy',
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, operation_id_base=None):
|
|
||||||
"""
|
|
||||||
:param operation_id_base: user-defined name in operationId. If empty, it will be deducted from the Model/Serializer/View name.
|
|
||||||
"""
|
|
||||||
super().__init__()
|
|
||||||
self.operation_id_base = operation_id_base
|
|
||||||
|
|
||||||
def get_operation(self, path, method):
|
def get_operation(self, path, method):
|
||||||
operation = {}
|
operation = {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user