-
-
Notifications
You must be signed in to change notification settings - Fork 90
Content-Type is not validated #229
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
Comments
AFAIK, from when I was going through the code to troubleshoot some issues, the schema is validated only for content-type: application/json. The other content-types are ignored (not validated). |
I think that probably makes sense, but openapi-backend should project reject other types, otherwise the payloads are being passed without any validation. |
Right. I am not saying this is not a bug. |
…on/x-www-form-urlencoded Related to the following issues: openapistack#94 openapistack#229
It looks like openapi-backend isn't validating the Content-Type defined in the OpenAPI specification, and worse it will happily pass along payloads that aren't valid. For a quick example, if I have an endpoint defined as such:
The validation works great when I pass a Content-Type: application/json header, but if I set the header value to text/plain, the endpoint is called with no validation and the payload is empty. Is there perhaps an easy way to verify the content is as expected?
The text was updated successfully, but these errors were encountered: