diff --git a/drf_spectacular/plumbing.py b/drf_spectacular/plumbing.py index 5fbbe677..3a31252b 100644 --- a/drf_spectacular/plumbing.py +++ b/drf_spectacular/plumbing.py @@ -1344,11 +1344,12 @@ class TmpView(views.APIView): ) view.kwargs = {} # prepare AutoSchema with "init" values as if get_operation() was called - view.schema.registry = registry - view.schema.path = path - view.schema.path_regex = path - view.schema.path_prefix = '' - view.schema.method = method.upper() + schema: Any = view.schema + schema.registry = registry + schema.path = path + schema.path_regex = path + schema.path_prefix = '' + schema.method = method.upper() return view diff --git a/drf_spectacular/views.py b/drf_spectacular/views.py index 95f0f975..15c49b3e 100644 --- a/drf_spectacular/views.py +++ b/drf_spectacular/views.py @@ -46,7 +46,7 @@ class SpectacularAPIView(APIView): - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json - """) + """) # type: ignore renderer_classes = [ OpenApiYamlRenderer, OpenApiYamlRenderer2, OpenApiJsonRenderer, OpenApiJsonRenderer2 ] diff --git a/tests/test_extend_schema.py b/tests/test_extend_schema.py index 213e2571..a9c64fe0 100644 --- a/tests/test_extend_schema.py +++ b/tests/test_extend_schema.py @@ -58,7 +58,7 @@ class QuerySerializer(serializers.Serializer): ) order_by = serializers.MultipleChoiceField( choices=['a', 'b', 'c'], - default=['a'], + default=['a'], # type: ignore ) tag = serializers.CharField(required=False) diff --git a/tests/test_extensions.py b/tests/test_extensions.py index d32f3bd3..a12f0469 100644 --- a/tests/test_extensions.py +++ b/tests/test_extensions.py @@ -126,7 +126,7 @@ def get(self, request): @api_view() -def x_view_function(): +def x_view_function(request): """ underspecified library view """ return Response(1.234) # pragma: no cover diff --git a/tests/test_i18n.py b/tests/test_i18n.py index 1265609b..0864dd9c 100644 --- a/tests/test_i18n.py +++ b/tests/test_i18n.py @@ -32,7 +32,7 @@ class Meta: class XViewset(mixins.ListModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet): __doc__ = _(""" More lengthy explanation of the view - """) + """) # type: ignore serializer_class = XSerializer queryset = I18nModel.objects.none()