Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kotlin] Invalid enum var names #76

Closed
Zomzog opened this issue May 16, 2018 · 0 comments · Fixed by #77
Closed

[Kotlin] Invalid enum var names #76

Zomzog opened this issue May 16, 2018 · 0 comments · Fixed by #77

Comments

@Zomzog
Copy link
Contributor

Zomzog commented May 16, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants