-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Submit An Array of Integer Elements In formdata #4741
Comments
@Crackz So you want a multipart request with duplicate field names?
OpenAPI 3.0 Specification says this will be the case when uploading an array of files: requestBody:
content:
multipart/form-data:
schema:
properties:
# The property name 'file' will be used for all files.
file:
type: array
items:
type: string
format: binary but I'm not sure if this is supported for arrays of primitives. @webron do you happen to know this? Exploded arrays |
@hkosova yes exactly
but i can't find a way to change this behavior and also tried style and explode but failed to make it work. |
Thanks for bringing up the question, and this is indeed a bug. There some subtle differences when the spec is referring to To further control how these request bodies are serialized, we also introduced the Encoding Object which has support for |
@hkosova was kind enough to point out to me that I was completely missed the point and was talking... somewhat nonsense. I kept talking about From reading the spec, I don't see a clear way to define what you're looking for, @Crackz, so I'd suggest filing a ticket with the spec itself. At the moment, there's nothing we can do more to solve this. |
I just ran into this bug as well. My case is with application/x-www-form-urlencoded. I think the issue is related to the requestBody section. I am attaching an example where explode is set to true in both the parameter block and the requestBody and they behave differently. The example midway down this page mentions that you can specify the explode param in the encoding block for the requestBody - https://swagger.io/docs/specification/describing-request-body/ I'm using that exact example, except setting explode to true.
|
@seanmetrix since it's a different media type, it's a different issue than the OP. Please file a new ticket so we can work on it separately. |
@Crackz the next version of the spec, OpenAPI 3.1, will support exploded arrays in |
i will try it when gets supported |
In this comment above, I can see that the array types have "Add Item button", but its now showing what type of array is it... here its of type string. I am facing a same issue at my end. |
Thanks @mathis-m, will test with the dist of that version and get back if any concerns :) |
Swagger sends the field location (array) as a single value
i expected that the field(location) will be repeated for each element in the array
how would i make it work this way ?
The text was updated successfully, but these errors were encountered: