redux-toolkit: Bug: codegen-openapi incorrectly handles multipart/form-data requests
OpenAPI spec:
"/api/Avatar": {
"post": {
"tags": [
"Avatar"
],
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"file": {
"type": "string",
"format": "binary"
}
}
},
"encoding": {
"file": {
"style": "form"
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
},
"application/json": {
"schema": {
"type": "string"
}
},
"text/json": {
"schema": {
"type": "string"
}
}
}
}
}
}
},
When you generate API using above specification and send a request you will see that the request content-type
is application/json
, but should be multipart/form-data
. This obviosly results in 415 (Unsupported Media Type)
returned from the server.
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 4
- Comments: 17 (2 by maintainers)
Yeah, I know about the situation with multiple codegen PRs being open and unmerged, and I’m really sorry for that. I just switched jobs and need to settle in right now. I do plan to tackle those, but it could still be a few weeks until I get to it.
The plan is to not necessarily add own code, but at least get through the PRs that will be open at that time, get them merged and cut a new release. So now would be a good moment to open PRs for outstanding bugs 😉
@Shaker-Pelcro : if there haven’t been any comments or releases, there are no updates.
There hasn’t been any active work on the codegen stuff in several weeks as far as I know.