-
Notifications
You must be signed in to change notification settings - Fork 38
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
Multipart Request Body Support #1150
Comments
Hi @jankuca I think your suggestion makes sense. What do you think of: @request({
contentType: 'multipart/form-data' // defaults to application/json
})
req(...) {}
@response({
status: 200,
contentType: 'multipart/form-data' // defaults to application/json
})
multiResp(...) {} We can allow multiple |
Yes, you are basically quoting my proposal:
Being able to specify different bodies based on the |
Yup, sorry the intention was only to be explicit with the config param naming. |
Multi-part form data is also a necessary use case in our implementation using Spot -- commenting to bring awareness back to this feature request! |
I've run into needing to document file upload endpoints that use this content type. (like in #8) |
(I have commented on a closed issue about this over two weeks ago but it got no attention: #8 – so I'm rather opening a new discussion here.)
The OpenAPI format can describe
multipart/form-data
request body content types but Spot does not support this. It is very common to have form-data endpoints and it is almost a must for file upload endpoints.It would be great to be able to describe such endpoints in Spot. I'm not completely sure about the right syntax though.
What I'm having in mind is:
@request({ type: 'multipart' })
or more explicit{ contentType: 'multipart/form-data' }
Based on the Swagger/OpenApi format, multipart bodies are described as the following:
It should be possible to specify parts of different content types (such as JSON, binary, string).
The text was updated successfully, but these errors were encountered: