Skip to content

Commit

Permalink
feat(generic): use GenericAutoSchema in ModelViewSet
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Dec 18, 2024
1 parent 4580a0a commit 3270307
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apis_core/generic/api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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()
Expand Down

0 comments on commit 3270307

Please sign in to comment.