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
  • #76
Closed
Open
Issue created May 16, 2018 by Administrator@rootContributor

[Kotlin] Invalid enum var names

Created by: Zomzog

Description

When enums name start with a number, the generated code won't compile

openapi-generator version

3.0.0-SNAPSHOT

OpenAPI declaration file content or url
"enum":[
    "1name"
]
Command line used for generation

java -jar openapi-generator-cli.jar generate -i swagger.json -c config.json -l kotlin -o tmp

Steps to reproduce

Add an enum parameter to swagger file; generate and compile.

Related issues/PRs
Suggest a fix/enhancement

The enumeration name can be prefixed by an underscore, it's done like this for the model name.

Another solution is to surround illegals names with backticks, but enum may be tricky to use (Status.1available). And what I understand of kotlin coding convention is backticks are acceptable only for names in tests.

Assignee
Assign to
Time tracking