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
Support for multipart/mixed
(and possibly better multipart/*
support in general)
#3721
Comments
It's also worth noting that when uploading multiple files for a form field with |
EDIT: guess I should have read your link. Another multipart option missing is the ability to send multiple files in a single form field. It should be a form-data payload with a nested multipart body with individual parts for each file. There is no way to define a nested multipart payload. This is as far as I can get with it. But no way to define the nested body parts if I were to send multiple file types requestBody:
content:
'multipart/form-data':
schema:
name:
type: string
file:
type: string
format: binary
encoding:
name:
headers:
content-disposition:
schema:
type: string
contentType: 'application/json'
file:
headers:
content-disposition:
schema:
type: string
contentType: 'multipart/mixed' |
@jeremyfiel I know that I noticed that the most recent |
A big missing piece from the Because the RFC is so old, and was originally for email messaging, apparently they didn't have a need to identify the body parts and the form-data RFC didn't address the if we could depend on this same header, I think it would help quite a lot to define mixed bodies with OAS, with the same syntax as |
I'm not entirely sure we have a nested implementation, but we do heavily use |
So it turns out that, in theory, support for
The question remains, how is it supposed to work? Somewhere during the extensive GitHub archaeology involved in digging this up, I thought I found an example of someone using a Unfortunately, But I'm guessing that even if you can use I still need to take another pass at reading how array instances work with the Encoding Object as their might be something there, at least if all of the parts are of the same type (which kind of goes against the whole 🤔 |
We occasionally see folks trying to use OAS with
multipart/mixed
, which does not support it. But it would not be hard to define a mapping along the lines ofmultipart/form-data
but with more of an array model. See also discussion #2599. I think @jeremyfiel also has experience with this.[EDIT: See also
multipart/x-mixed-replace
which AFAICT does not have a usable specification as WHATWG explicitly states in that section that there spec "describes processing rules for web browsers" and relegates everything else tomultipart/mixed
... I guess non-web-browsers aren't supposed to process it? 😒 ]The text was updated successfully, but these errors were encountered: