Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify different serializer classes for request and response #336

Closed
symonsoft opened this issue Mar 24, 2019 · 1 comment
Closed

Specify different serializer classes for request and response #336

symonsoft opened this issue Mar 24, 2019 · 1 comment

Comments

@symonsoft
Copy link

symonsoft commented Mar 24, 2019

I'm pretty satisfied with drf-yasg, but unable to find the way to specify different serializer classes for request and response. By default Swagger UI shows the model derived from <view-set>.serializer_class value for both request and response no matter what serializer the response really uses.
Should I use ManualSchema or something?

@parander
Copy link

parander commented Mar 25, 2019

What about something like this?

@swagger_auto_schema( query_serializer=RequestSerializer(), responses={200: ResponseSerializer()} )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants