You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.
I'm trying to override specific serializers within a view and providing a get_serializer_class seems to work fine for DRF. However, when swagger introspects the viewset I can't seem to see any way of getting the action or path from the request so am unable to provide the right serializer.
It there any way around this? I've tried setting self.serializer_class within the action itself but that (obviously) isn't even called by Swagger.
The text was updated successfully, but these errors were encountered:
dochead
changed the title
No action provided in get_serializer
No action provided in get_serializer_class
Sep 17, 2014
how do you suppose rest swagger to call static code? especially when get_serializer_class may contain logic that is bounded to a request object.
IMO, you should use YAML format for this and define your serializer directly in docstring (thats what we do). Take a look at my pull request: #60 feel free to fork and finish it so @marcgibbons will merge it into master. (im out of time lastly)
I'm trying to override specific serializers within a view and providing a get_serializer_class seems to work fine for DRF. However, when swagger introspects the viewset I can't seem to see any way of getting the action or path from the request so am unable to provide the right serializer.
It there any way around this? I've tried setting self.serializer_class within the action itself but that (obviously) isn't even called by Swagger.
The text was updated successfully, but these errors were encountered: