def get_overrides(self, view, method): """Get overrides specified for a given operation. :param view: the view associated with the operation :param str method: HTTP method :return: a dictionary containing any overrides set by :func:`@swagger_auto_schema <.swagger_auto_schema>` :rtype: dict """ method = method.lower() action = getattr(view, 'action', method) action_method = getattr(view, action, None) overrides = getattr(action_method, '_swagger_auto_schema', {}) # _swagger_auto_schema 에 해당하는 값을 직접 주입 if not overrides: signature = inspect.signature(action_method) request_params = signature.parameters.get("request").annotation overrides = { "request_body": Schema( type=openapi.TYPE_OBJECT, properties={key: Schema(type=openapi.TYPE_STRING, description='string') for key, val in request_params.items()} ) } # _swagger_auto_schema 에 해당하는 값을 직접 주입 if method in overrides: overrides = overrides[method] return copy.deepcopy(overrides)