[typescript] Align multipart file array handling#24133
Open
hwisu wants to merge 5 commits into
Open
Conversation
4 tasks
Contributor
There was a problem hiding this comment.
1 issue found across 18 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
677941b to
cd404a4
Compare
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.
Summary
typescript-fetch,typescript-axios, andtypescript-inversify.parameter.itemsis binary.AbstractTypeScriptClientCodegen.Root Cause
For
type: arraywithitems: { type: string, format: binary }, the file metadata is on the item schema, not the array schema. These TypeScript generators only checkedparameter.dataFormat == "binary", so they could serialize file arrays as csv form values instead of repeated multipart fields.Cross-Generator Consistency
The same OpenAPI shape is already covered by other generators:
modules/openapi-generator/src/test/resources/3_0/form-multipart-binary-array.yamldefinesfilesas an array of binary items.List<MultipartFile> fileswith@RequestPart("files").List<FormDataBodyPart> files.formParams.addAll("files", ...).This change applies the same item-level binary check to the affected TypeScript clients.
Regression Safety
typescript-axiosandtypescript-inversifyuseisCollectionFormatMultifor repeated field serialization.typescript-fetchalso needsisFileso multipart requests useFormData.typescript-axiosecho sample produced no diff.typescript-inversifypetstore sample produced no diff.typescript-fetchsample for this case.Validation
./mvnw -pl modules/openapi-generator -am -Dtest=TypeScriptFetchClientCodegenTest,TypeScriptAxiosClientCodegenTest,TypeScriptInversifyClientCodegenTest -Dsurefire.failIfNoSpecifiedTests=false test./bin/generate-samples.sh bin/configs/typescript-fetch-multipart-file-array.yaml./bin/generate-samples.sh bin/configs/typescript-axios-echo-api.yaml./bin/generate-samples.sh bin/configs/typescript-inversify.yamlgit diff --check upstream/master...HEAD./mvnw -pl modules/openapi-generator-cli -am -DskipTests package./mvnw clean package./bin/generate-samples.sh ./bin/configs/*.yaml./bin/utils/export_docs_generators.shFixes #22597
PR checklist
Technical committee
This PR targets TypeScript clients (
typescript-fetch,typescript-axios, andtypescript-inversify).cc @davidgamero @mkusaka @joscha @dennisameling