From 5ac9bea78b2eafabdb64d886ce613cbb3ca534aa Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Wed, 18 Dec 2024 10:16:30 +0100 Subject: [PATCH] feat(generic): use GenericAutoSchema in ModelViewSet --- apis_core/generic/api_views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apis_core/generic/api_views.py b/apis_core/generic/api_views.py index 1e70ad1ee..50909efdd 100644 --- a/apis_core/generic/api_views.py +++ b/apis_core/generic/api_views.py @@ -3,6 +3,7 @@ from .filterbackends import GenericFilterBackend from .helpers import first_member_match, makeclassprefix, module_paths from .serializers import GenericHyperlinkedModelSerializer, serializer_factory +from apis_core.generic.schema import GenericAutoSchema class ModelViewSet(viewsets.ModelViewSet): @@ -15,6 +16,7 @@ class ModelViewSet(viewsets.ModelViewSet): """ filter_backends = [GenericFilterBackend] + schema = GenericAutoSchema() def dispatch(self, *args, **kwargs): self.model = kwargs.get("contenttype").model_class()