I\'m developing an API with Django Rest framework, and I would like to dynamically remove the fields from a serializer. The problem is that I need to remove them depending o
You can create multiple serializers and choose the proper one in view
class IndexView(APIView): def get_serializer(self): if self.request.GET['flag']: return SerializerA return SerializerB
use inheritance to make serializers DRY.