Closed mathoglu closed 4 years ago
I don't believe openapi-client-axios has any special handling for multipart/form-data
. Your problem must lie elsewhere. I'm not at all sure what you're talking about when you say "generated code".
You should just use the underlying axios client to provide the corrext request body.
Working with a image upload endpoint and noticed the generated client do not work as expected for multipart/form-data requests.
After some debugging it seems like the client creates a new FormData object and appends the files in the wrong way.
From the generated code:
This will produce a request containing "[Object File], [Object File]..." in the body.
The correct way should be (tried it out and worked as expected) to something like
This will produce the correct request body as also demonstrated here.
Im using the following OpenAPI definition for the endpoint: