-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
Malformed path parameter returns 404 instead of 400 #770
Comments
I think what's happening is that the path parameters generate routes for Flask. We could drop all types from Flask routes to ensure that parameters make it through to validation - I'm not sure yet what the full implications of that would be. I'll try to play around with it today. |
I just worked through an issue with similar symptoms (I'm guessing it's the same core issue, but someone with a deeper knowledge of connexion may know better). I added a new path to an existing (and working) project, but was getting 404s in all cases while testing. I narrowed it down to this trivial reproduction case: Openapi spec:
With the corresponding handler:
All calls to In my case, I intended the parameter to be an int, so |
Just a little push since the bug is still present in version 2.9.0. It's not breaking but the wrong error message and status code is very confusing for users of an API. |
Hi @D3nn3, I'm afraid this issue is not at the top of our priority list at the moment. We currently match Flask behavior and while I agree that a Note that this is not related to @jrheling routing with |
Closing this as a wontfix since routing needs to happen before validation, so a 404 error is thrown before reaching validation. |
Description
The documentation says that
strict_validation
should return a 400, however it appears to be returning a 404 insteadPer the documentation at https://connexion.readthedocs.io/en/latest/request.html#parameter-validation
Expected behaviour
Connexion returns a 400 Bad Request when a parameter does not match the schema
Actual behaviour
Connexion returns a 404 Not Found when a parameter does not match the schema
Steps to reproduce
Sample Curl Results
Sample Code
Sample OpenAPI v3 Document
Additional info:
Output of the commands:
The text was updated successfully, but these errors were encountered: