-
-
Notifications
You must be signed in to change notification settings - Fork 773
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
JSON request bodies are not strictly validated #837
Comments
Hey @lsorber - Can you say more about how the the GitHub change is related to this ticket? AFAICT In OpenAPI 3.0.x I believe you can use the The OpenAPI folks decided that We could potentially have What do you think? |
So what's the scope of cc @dtkav |
AFAICT originally in swagger 2.0, It's unclear how It has been a goal of mine to move the validation out of connexion and into the openapi-spec-validator as much as possible for separation of concerns. |
I think that that goal is actually correct. That means that once that goal is achieved Still, I am little puzzled as to what is currently still strictly validated under Cheers 👍 |
Sorry @kornicameister - this state of validation is pretty confusing (I have been trying to fix it with #760) The The biggest problem with connexion validation at the moment comes from this line: Which basically means that if your API endpoint doesn't consume only json data, the body won't be validated (!). The only exception to this is if the endpoint consumes[0] is form-data (!). This issue has been around for a long time (before I started working on the project), and it means that connexion is significantly less useful for non-json (or even mixed content-type) apis. I'm attempting to fix it with #760 |
@dtkav I agree that if strict validation can be achieved with OpenAPI, that would be preferable. Unfortunately, it is not possible to combine One possible solution might be to add support for [1] https://stackoverflow.com/questions/22689900/json-schema-allof-with-additionalproperties |
I still have an issue using oneOf in a formdata with v2.7.0. Are we going to merge #760 or something to fix it? |
Description
GitHub is starting to apply strict validation in their REST API [1].
Connexion already has a
strict_validation
flag [2], but it doesn't apply to the request body if its content type is JSON.Expected behaviour
I would appreciate it if strict validation also validates JSON request bodies.
Related issue: #223
CC: @dsem
[1] https://developer.github.com/changes/2018-09-25-stricter-validation-coming-soon-in-the-rest-api/
[2] https://github.com/zalando/connexion/blob/master/docs/request.rst#parameter-validation
The text was updated successfully, but these errors were encountered: