[BUG][Typescript Axios] Content-type not set
Created by: julaudo
Description
Typescript axios generators does not handle correctly multipart requests. Content-Type header is never set.
openapi-generator version
4.0.0-beta3
OpenAPI declaration file content or url
openapi: 3.0.0
paths:
'upload':
post:
summary: Upload File
description: ''
operationId: uploadFile
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/logoForCreation'
encoding:
medicalCertificateFileName:
contentType: image/png, image/jpeg
required:
true
description: body
responses:
201:
description: Created or updated club's logo
content:
application/json:
schema:
$ref: '#/components/schemas/photo'
components:
schemas:
logoForCreation:
type: object
required:
- logoFileName
properties:
logoFileName:
type: string
format: binary
photo:
required:
- location
properties:
location:
type: string
Command line used for generation
openapi-generator generate -i swagger.yaml -g typescript-axios -o src/generated --skip-validate-spec
Steps to reproduce
Run the above command with the included yaml Notice that the following expected line is missing: localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
Suggest a fix
multipartFormData mustache is used without vendorExtensions so it's not detected