-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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 Content-Type #303
Comments
👍 for implementing this :) |
Is there some way that a work around to at least allow a user to hand enter (or use the example to enter) the http body (including sub requests with their headers etc) and get them all back for multipart/mixed request/response? |
As a workaround for a
|
@grokify that's good to know thanks i'll try this out first thing tomorrow, how about the response though? So far I haven't been able to get it to show a response with multipart/mixed at all. |
The above doesn't pass the validator, you have to add If only the default would work and a simple string example response I think most would be in business with at least a workaround. |
@Gaillard - when you say 'allow the user to hand enter', do you mean via swagger-ui or in general? |
Yes I mean in the UI. It would be great if the user could choose content type, body and headers of each multi part, but as a work around if we could let the user hand enter that like @grokify showed it would help tremendously. His way works unless you also want it to run through the validator, can that bug be fixed? |
@Gaillard you have to add "consumes" : ["multipart/mixed; boundary=Boundary-----1234567890"],
"parameters" : {
"in": "body",
"schema": { "type": "object" },
"default" : "--Boundary-----1234567890\n ... EXAMPLE HERE ... \n--Boundary-----1234567890--"
} |
That does not pass the validator though. I'm running the validator locally. |
What error do you get from the validator? |
That the schema doesn't match. |
Also an example of the response does not work. Just like for this to be useful without full multipart/mixed support, we need a default to show the user in and out. It works with object schema type for the response but then shows in the example model like
which doesn't make any sense and why I was trying to use type string. So if the way it works with object could be there for string, it would be a decent workaround. |
@Gaillard - let's take this to the google group as it's not directly related to the issue (this is just a workaround we're trying to employ, it won't change the issue at hand). There, just provide me with the definition of the POST /{version}/batch path, what you expect to see in the ui and what you actually experience. |
Ok posted, thanks |
Feature request: |
Any updates on Content-Type and boundary? |
See #878 |
Has anyone involved in this thread used |
I have a use case to support the
multipart/mixed
content type as defined in RFC 2049. Use of this content type includes support for:Content-Type
headerIt seems like it would be ideal if Swagger could enable defining each part as a parameter with content type and, on submission, have Swagger UI create the MIME boundary, add the boundary to the HTTP request
Content-Type
header, and assemble the multipart parameters into a multi-part request body using the boundary.It would be great to support this in Swagger natively.
The text was updated successfully, but these errors were encountered: