Skip to content

Commit

Permalink
Merge pull request #867 from Numerlor/drf-rw-serializers-use-direct-get
Browse files Browse the repository at this point in the history
Use direct view methods for getting serializer instances in drf_rw_serializers schema blueprint
  • Loading branch information
tfranzel authored Nov 23, 2022
2 parents 2aabb8b + c7209e0 commit d19d263
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/blueprints/drf_rw_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class CustomAutoSchema(AutoSchema):

def get_request_serializer(self):
if isinstance(self.view, RWGenericAPIView):
return self.view.get_write_serializer_class()()
return self.view.get_write_serializer()
return self._get_serializer()

def get_response_serializers(self):
if isinstance(self.view, RWGenericAPIView):
return self.view.get_read_serializer_class()()
return self.view.get_read_serializer()
return self._get_serializer()

0 comments on commit d19d263

Please sign in to comment.