-
Notifications
You must be signed in to change notification settings - Fork 440
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
For GET request, parsed parameters from request_body are presented as response body #16
Comments
The problem is in fact that, in django rest framework, there is no way for a view to declare what it returns, so this library assumes that endpoints which receive a request body return it back (for example, For custom views like yours, the right thing is to also explicitly declare your response body in On the other hand, HTTP get requests are not usually expected to receive request bodies, that is generally only the case for POST, PUT, PATCH requests. In your case, where what you really want is a query parameter, the -- A warning when passing request_body to unappropriate HTTP methods could also be useful. |
Sorry. Yes, I think |
Allows for easier generation of query Parameters from a Serializer object. See also #16.
Added & uploaded new version. |
View code
swagger spec generated
As a workaround, I assume, one should specify parameters as
openapi.Parameter
objects, likewhich works just fine.
The text was updated successfully, but these errors were encountered: