fix(gen): set Explode:false for multipart arrays #1323
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
problem
currently the gen code from the schema below raises invalid length uuid error, when receiving multiple array items
here, there seems to be multiple possible ways to describe array in multipart/form-data as I looked shallowly on the internet (no canonical information like RFC kind), for example:
1. single key comma separated
2. multiple keys
3. multiple bracketed keys
the error above occurs when format 1. is specified, because ogen uses hardcoded
Explode:true
for the array decoding, and then parse comma separated values as a single uuidsolution
set Explode to false for multipart array
others
encoding
field that can be used to specify thestyle
andexplode
of multipart data, which was introduced from OpenAPI3.1 , ideally we might wanna see this field somedayParseMultipartForm()
from standard http package before its own parsing logic, and seems like this one accepts the format 1. only (forformat 2. and 3. only first item is picked and the rest is ignoredthis might not be true), and might need more investigation to thoroughly support things