[java][microprofile] Emit List<File> to upload multiple files when declaring an array of binary forms - #24453
Merged
wing328 merged 1 commit intoJul 26, 2026
Conversation
Ignacio-Vidal
marked this pull request as draft
July 26, 2026 02:10
A `type: array` of `format: binary` form properties was collapsed onto the scalar `File` type, so a multi-file upload was generated with the same signature as a single-file one and only one file could ever be sent. The array dimension is now preserved and such a parameter is generated as `List<File>`. A single binary property is still bound to a scalar `File`, so existing specs are unaffected.
Ignacio-Vidal
force-pushed
the
java-microprofile-files-upload
branch
from
July 26, 2026 02:23
32a3881 to
ec060f6
Compare
Ignacio-Vidal
marked this pull request as ready for review
July 26, 2026 11:23
Contributor
Author
|
@wing328 - any chance you could review? |
Member
|
lgtm. thanks for the fix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A
type: arrayofformat: binaryform properties was collapsed onto the scalarFiletype, so a multi-file upload was generated with the same signature as a single-file one — only the array dimension was silently dropped, and only one file could ever be sent.Given:
Before (identical to the single-file signature):
After:
A single binary property is still bound to a scalar
File, so existing specs are unaffected — the petstore samples are byte-identical to master.isArraywas already populated on file parameters, so this is a template-only change (formParams.mustacheandformParamsImpl.mustache);This is the client-side counterpart of #24455, which fixes the same limitation in
jaxrs-spec. The two are independent and can be merged in either order.Testing
JavaClientCodegenTest(testMicroprofileFormMultipartArray), reusing the existing3_0/form-multipart-binary-array.yamlfixture and following the same shape as the neighbouringtestRestTemplateFormMultipart/testWebClientFormMultiparttests.PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
Summary by cubic
Fixes multi-file uploads in the Java MicroProfile client by preserving the array dimension for binary form fields. Multi-file params now generate as
List<File>; single-file staysFile.@FormParam("...") List<File> paramDetailfortype: array+format: binary; scalar staysFile.formParams.mustache,formParamsImpl.mustache; noDefaultCodegenchanges.testMicroprofileFormMultipartArrayusing3_0/form-multipart-binary-array.yaml; all tests pass.Written for commit ec060f6. Summary will update on new commits.