diff --git a/rest_framework/generics.py b/rest_framework/generics.py index 55cfafda4..425b9376d 100644 --- a/rest_framework/generics.py +++ b/rest_framework/generics.py @@ -105,11 +105,11 @@ class GenericAPIView(views.APIView): Return the serializer instance that should be used for validating and deserializing input, and for serializing output. """ - serializer_class = self.get_serializer_class() + serializer_class = self.get_serializer_class(*args, **kwargs) kwargs.setdefault('context', self.get_serializer_context()) return serializer_class(*args, **kwargs) - def get_serializer_class(self): + def get_serializer_class(self, *args, **kwargs): """ Return the class to use for the serializer. Defaults to using `self.serializer_class`.