diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java index 92edd26b582c..cbadf4844091 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java @@ -20,11 +20,7 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.parser.util.SchemaTypeUtil; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.utils.ModelUtils; @@ -146,15 +142,18 @@ public Map postProcessOperationsWithModels(Map o .filter(op -> op.consumes.stream().anyMatch(opc -> opc.values().stream().anyMatch("multipart/form-data"::equals))) .forEach(op -> { op.vendorExtensions.putIfAbsent("multipartFormData", true); - op.allParams.stream() - .filter(param -> param.isFormParam) - .filter(param -> param.isArray) - .filter(param -> param.dataFormat.equals("binary")) - .forEach(param -> param.isCollectionFormatMulti = true); }); return objs; } + @Override + public void postProcessParameter(CodegenParameter parameter) { + super.postProcessParameter(parameter); + if (parameter.isFormParam && parameter.isArray && "binary".equals(parameter.dataFormat)) { + parameter.isCollectionFormatMulti = true; + } + } + @Override public Map postProcessAllModels(Map objs) { Map result = super.postProcessAllModels(objs);