OpenAPI not encoding multipart/mixed correctly
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OpenAPI not encoding multipart/mixed correctly
This is how the relevant portion of my endpoint looks like:
"/global-types/import-coordinates":
post:
summary: Import coordinates
operationId: importCoordinates
requestBody:
content:
multipart/mixed:
schema:
type: object
properties:
file:
type: string
format: binary
attributes:
type: array
items:
type: string
identifier:
type: string
required:
- file
- attributes
- identifier
responses:
201:
$ref: 'model.yaml#/components/responses/created'
400:
$ref: 'model.yaml#/components/responses/badRequest
However, when I call the generated function from TypeScript:
- file is not encoded properly. Chrome DevTools show it to be of type object File instead of binary
- The request fails with exit code 415 Unsupported Media Type
I found this issue on OpenAPIs GitHub. It's very old, but still not closed. Might this be related to my issue?
This is my first post to this forum, so please tell me, if you need more information. Thank you for every incoming reply or effort to help me out with this.
- Labels:
-
Swagger Codegen
-
Swagger Core
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes we have the same problem with multipart/mixed and multipart/form-data not being rendered correctly when it generates the cURL command. We have a bug-fix request with Smartbear for over one month now and still no resolution. And apparently the issue has been there for quite some time. According to their documentation it should work. This is really becoming a big issue for us now. Not sure why taking them so long to fix this problem.
