-
Notifications
You must be signed in to change notification settings - Fork 6k
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
TypeScript Fetch client doesn't support multipart/form-data body #3921
Milestone
Comments
@janslow thanks for reporting the issue. May I know if you've time to contribute the fix? |
3 tasks
Just wondering whether there is any update with this issue? |
Hey, guys! What about this issue? When you planning to fix that bug? |
11 tasks
+1 |
Any news on a fix? currently we can't use any endpoint which uploads a file because of this 😢 . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
If a POST operation accepts
multipart/form-data
, thetypescript-fetch
client posts anapplication/x-www-form-urlencoded
body instead of form data.Swagger-codegen version
Version currently deployed on [editor.swagger.io]
Swagger declaration file content or url
Command line used for generation
"Generate Client" -> "TypeScript Fetch" on [editor.swagger.io]
Steps to reproduce
Content-Type
ofapplication/x-www-form-urlencoded
instead ofmultipart/form-data
.Suggest a Fix
Instead of setting the Content-Type and using
querystring
to serialize the contents (formultipart/form-data
requests), it should just set the body to an instance ofFormData
instead ofe.g., in
DefaultApiFetchParamCreactor#upload
, instead of :it should generate (as
Content-Type
is set tomultipart/form-data
automatically if usingFormData
):The text was updated successfully, but these errors were encountered: