-
-
Notifications
You must be signed in to change notification settings - Fork 769
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
Arrays are parsed incorrectly with multipart/form-data #1869
Comments
I found the
It's splitting the string parsed from the form data: connexion/connexion/uri_parsing.py Lines 163 to 166 in f8f461c
In my example I guess the splitting is place for URI params? Shouldn't we always use Maybe it's enough to switch the Would really appreciate feedback since our team is blocked by this 😅 |
Description
I use
multipart/form-data
with a propertybar
which is of typearray
. The encoding is set toapplication/json
. The spec looks like this:Expected behaviour
When running the request I'd expect to get the
bar
property passed into the body argument of my controller function.Actual behaviour
Server raises error:
Validation error: '["{\\n \\"baz\\": \\"string\\"\\n}"]' is not of type 'object' - 'bar.0'
.To me it looks like that the string is not properly parsed if it's an array. To verify I changed the type of
bar
fromarray
ofobject
's toarray
ofstring
's:I passed two strings "one" and "two" and received this dict in my controller function:
{'bar': ['["one"', '"two"]']}
.Steps to reproduce
Create a controller function, e.g.:
Adjust property
x-openapi-router-controller
accordingly.Fire up the swagger page or use curl to run the request.
Additional info:
Output of the commands:
python --version
: Python 3.11.6pip show connexion | grep "^Version\:"
: Version: 3.0.5The text was updated successfully, but these errors were encountered: