swagger-codegen
swagger-codegen copied to clipboard
[typescript-angular] File arrays do not use FormData
Description
When a formData file parameter is an array, the generated code does not properly trigger the use of FormData. The generated code works properly be manually changing the below line in the generated service method:
let useForm = false;
to
let useForm = canConsumeForm;
Swagger declaration file content or url
post:
operationId: UploadFiles
tags:
- Documents
summary: Creates a new document with a single revision.
consumes:
- multipart/form-data
parameters:
- name: files
in: formData
type: array
items:
type: file
responses:
'201':
description: Document created successfully
schema:
$ref: '#/definitions/DocumentSummaryResponse'
produces:
- application/json
Suggest a fix/enhancement
In addition to checking if the parameter is of type file, the code gen logic should also check if the items.type parameter is of type file. If so, set the isFile flag to true.
Same problem here.
Still an issue in 3.0.25
same here. really annoying