You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to define api for 'Multiple File Upload' which refer the part in swagger document File Upload.
But the generated script deals with binaries as simple string.
{{#isCollectionFormatMulti}}
{{paramName}}.forEach((element) => { localVarFormParams.append('{{baseName}}', element as any);})
{{/isCollectionFormatMulti}}
The text was updated successfully, but these errors were encountered:
shrkw
changed the title
[BUG] Description
[Bug][typescript-axios] When Multiple File Uploaded, it does not work as isCollectionFormatMulti
Aug 20, 2020
StringcollectionFormat = null;
// ... some lines do not assign other value to collectionFormat//TODO fix collectformat for form parameters//collectionFormat = getCollectionFormat(s);// default to csv:codegenParameter.collectionFormat = StringUtils.isEmpty(collectionFormat) ? "csv" : collectionFormat;
But, how do we specify a collectionFormat for Request Body Object ? I can only see collectionFormat for Parameter Object in OpenApi Specification (using style property) and this merge did not check collectionFormat.
Should we just remove the isCollectionFormatMulti check and some other lines?
Bug Report Checklist
Description
I want to define api for 'Multiple File Upload' which refer the part in swagger document File Upload.
But the generated script deals with binaries as simple string.
localVarFormParams.append('files', files.join(COLLECTION_FORMATS.csv));
openapi-generator version
v4.3.1
OpenAPI declaration file content or url
I added encoding parameter to force form style but not works well.
Generation Details
use this command.
Steps to reproduce
just run by above command, then it generate following script.
here is verbose output https://gist.github.com/shrkw/5002c71e33177b99c0529f1506d6ff22
and api.ts https://gist.github.com/shrkw/5002c71e33177b99c0529f1506d6ff22#file-api-ts-L77
Related issues/PRs
Not sure but may be same issue.
BUG multi file upload not implemented fully · Issue #6752 · OpenAPITools/openapi-generator · GitHub
Same issue is facing to this guy.
BUGJavaSpring multiple files upload · Issue #4803 · OpenAPITools/openapi-generator · GitHub
Suggest a fix
I want to set isCollectionFormatMulti attribute, but not sure how to do it.
openapi-generator/apiInner.mustache at f752f29af202885e6b817e5ec002facee1ef0c33 · OpenAPITools/openapi-generator · GitHub
The text was updated successfully, but these errors were encountered: