From c87837b025da33fd8ccca9b33837067c05700cc8 Mon Sep 17 00:00:00 2001 From: Martin Desrumaux Date: Fri, 28 Feb 2020 18:11:45 +0100 Subject: [PATCH] fix(openapi): remove duplicatde __init__ --- rest_framework/schemas/openapi.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index ac6482b26..5cbba1f9a 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -71,10 +71,14 @@ class SchemaGenerator(BaseSchemaGenerator): 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): raise ValueError('tags must be a list or tuple of string.') self._tags = tags + self.operation_id_base = operation_id_base super().__init__() request_media_types = [] @@ -88,13 +92,6 @@ class AutoSchema(ViewInspector): '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): operation = {}