-
Notifications
You must be signed in to change notification settings - Fork 335
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
Fix multiform bug #403
base: master
Are you sure you want to change the base?
Fix multiform bug #403
Conversation
-expected result is for swagger to interpret the api as consuming only 'multipart/form-data' -this result will fail in original implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
@@ -466,7 +466,7 @@ def serialize_operation(self, doc, method): | |||
doc_params = list(doc.get("params", {}).values()) | |||
all_params = doc_params + (operation["parameters"] or []) | |||
if all_params and any(p["in"] == "formData" for p in all_params): | |||
if any(p["type"] == "file" for p in all_params): | |||
if any(p["type"] == "file" or (p["type"]=="array" and p["collectionFormat"]=="multi") for p in all_params): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change
@@ -769,6 +769,25 @@ def get(self): | |||
assert "consumes" in op | |||
assert op["consumes"] == ["multipart/form-data"] | |||
|
|||
def test_parser_parameter_in_files_appended(self, api, client): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@SteadBytes @a-luna @j5awry @ziirish can trouble one of you to look thru this PR? Thanks! |
Was wondering if someone could approve this merge request so that uploads through restx work? Been having a tough time |
0db7d06
to
4eaf373
Compare
Looks like this got approved and pushed somewhere, but ultimately never got merged? |
Does anyone know if this fix will be merged? |
@gerardoemr @pbaylies Thanks for bumping this, I will try and get it merged over the weekend and released if it's something you need! |
Someone has updates on this PR? It would be great if it's merged to the main code base.. |
This PR fixes the bug where Swagger does not interpreting an API consuming an array of files, as requiring the request to be a multipart-form. Others have reflected this problem, e.g. #177.
To fix this, this PR makes the following changes over 2 commits.
swagger.py
to fix the bug. This passes the expanded test suite above.