Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #2694
Closed
Open
Issue created Apr 18, 2019 by Administrator@rootContributor

[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

Assignee
Assign to
Time tracking