Bug Report Checklist
Description
I have the exact use case as described on #7247 for uploading multiple files, but apparently the 'isCollectionFormatMulti' is not set to 'true' on those cases and therefore the generator still handle those parameters as strings.
openapi-generator version
Latest master (3de5370)
OpenAPI declaration file content or url
openapi: 3.0.3
info:
title: test
version: "1.0.0"
tags:
- name: test
description: test
servers:
- url: http://localhost:3000
paths:
/api/upload:
post:
tags: []
operationId: upload files
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
message:
type: string
files:
type: array
items:
type: string
format: binary
required:
- message
responses:
200:
description: ok
Generation Details
openapi-generator-cli.jar generate -i foo.yaml -g typescript-axios -o foo
Steps to reproduce
Generate the client via the above command. Verify that the output contains the following lines:
if (files) {
localVarFormParams.append(files.join(COLLECTION_FORMATS.csv));
}
The desired output should be
if (files) {
files.forEach((element) => {
localVarFormParams.append('files', element as any);
})
}
Related issues/PRs
#7247 #7814
Suggest a fix
Correctly set the flag to true on postProcessParameter. I am going to submit a PR addressing it.
Bug Report Checklist
Description
I have the exact use case as described on #7247 for uploading multiple files, but apparently the 'isCollectionFormatMulti' is not set to 'true' on those cases and therefore the generator still handle those parameters as strings.
openapi-generator version
Latest master (3de5370)
OpenAPI declaration file content or url
Generation Details
openapi-generator-cli.jar generate -i foo.yaml -g typescript-axios -o fooSteps to reproduce
Generate the client via the above command. Verify that the output contains the following lines:
The desired output should be
Related issues/PRs
#7247 #7814
Suggest a fix
Correctly set the flag to true on
postProcessParameter. I am going to submit a PR addressing it.