-
-
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
Connexion claims extra formData parameters that are in the spec #1020
Comments
Ping... |
To add on this: I think the bug is in this function but I'm not sure how it is supposed to work properly: |
@jmdejong Did you make any headway on this? |
I see this error in 2.5.1 but not in 2.3.0. |
I was able to reproduce the bug on master. |
When using an OAS3 spec with formdata, the validation logic looks for the key 'formData' in the spec parameters list. This keys is specific to OAS2, and will never be present, causing any form data to throw an ExtraParameterProblem.
Please note that |
When using an OAS3 spec with formdata, the validation logic looks for the key 'formData' in the spec parameters list. This keys is specific to OAS2, and will never be present, causing any form data to throw an ExtraParameterProblem.
When using an OAS3 spec with formdata, the validation logic looks for the key 'formData' in the spec parameters list. This keys is specific to OAS2, and will never be present, causing any form data to throw an ExtraParameterProblem.
Just to clarify: I'm not a Connexion dev. I just encountered this bug too and dug into the codebase in order to try to make it easier for the developers to fix this. |
Are you running into the bug on the latest release? |
Description
I have a simple service that expects a POST to a certain endpoint. There's 1 parameter in the requestBody of the POST ("customerId"), and also a header parameter ("Authorization").
If I turn on
strict_validation=True
and I send a valid request to the endpoint, I get:Extra formData parameter(s) customerId not in spec
.Expected behaviour
The
customerId
parameter is in the spec, so Connexion should accept the post and call the endpoint's business logic, rather than returning a 400.Actual behaviour
Returns:
Steps to reproduce
I'm using this spec.yaml:
And this app.py:
And hello.py is just:
Then, send a (valid) request to the endpoint. I'm using the
httpie
utility, although you can exercise the bug with the SwaggerUI too.http -v -f POST http://localhost:8000/v1.0/test "Authorization: Bearer abcd" "customerId=4"
You will see the 400 response mentioned above.
Additional info:
It seems like having the header in the spec is necessary to make the bug happen. If you take out the
parameters:
block, it works.Output of the commands:
python --version
:Python 3.6.6
pip show connexion | grep "^Version\:"
Version: 2.3.0
The text was updated successfully, but these errors were encountered: