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
  • #9024
Closed
Open
Issue created Mar 20, 2021 by Administrator@rootContributor

[BUG] typescript-axios - boolean enum is generated as string enum

Created by: haedaal

Description

following schema

    "schemas": {
      "BooleanEnum": {
        "enum": ["true", "false"],
        "type": "boolean"
      },

currently generates

export enum BooleanEnum {
    True = 'true',
    False = 'false'
}

This bug is affecting every typescript codegen, though a fix does not fix all of those

openapi-generator version

latest master

OpenAPI declaration file content or url

https://gist.github.com/haedaal/a771d6f3df337b624ae8a2c2d176c0db

Generation Details
Suggest a fix

It should generate this

export enum BooleanEnum {
    True = true,
    False = false
}

or this because of TS18033

export type BooleanEnum = true | false
Assignee
Assign to
Time tracking