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.
Important
Merging this pull request will create this release
Breaking Changes
Removed ability to set an array as a multipart body
Previously, when defining a request's body as
multipart/form-data, the generator would attempt to generate codefor both
objectschemas andarrayschemas. However, most arrays could not generate valid multipart bodies, asthere would be no field names (required to set the
Content-Dispositionheaders).The code to generate any body for
multipart/form-datawhere the schema isarrayhas been removed, and any suchbodies will be skipped. This is not expected to be a breaking change in practice, since the code generated would
probably never work.
If you have a use-case for
multipart/form-datawith anarrayschema, please open a new discussion with an example schema and the desired functional Python code.Change default multipart array serialization
Previously, any arrays of values in a
multipart/form-databody would be serialized as anapplication/jsonpart.This matches the default behavior specified by OpenAPI and supports arrays of files (
binaryformat strings).However, because this generator doesn't yet support specifying
encodingper property, this may result innow-incorrect code when the encoding was explicitly set to
application/jsonfor arrays of scalar values.PR #938 fixes #692. Thanks @micha91 for the fix, @ratgen and @FabianSchurig for testing, and @davidlizeng for the original report... many years ago 😅.