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

Problem with kotlin keywords as enum values #5689

Closed
Pe-te opened this issue Mar 24, 2020 · 2 comments
Closed

Problem with kotlin keywords as enum values #5689

Pe-te opened this issue Mar 24, 2020 · 2 comments

Comments

@Pe-te
Copy link
Contributor

Pe-te commented Mar 24, 2020

I got this output from the generator, but Android Studio complains about external being a keyword in kotlin. Unfortunatelly we have a legacy API and cannot change the field name there.

enum class Type(val value: kotlin.String){
    @SerializedName(value="icon")  icon("icon"),
    @SerializedName(value="external")  external("external");
}

macOS, homebrew, openapi-generator 4.2.3

@stapel
Copy link
Contributor

stapel commented Jun 2, 2020

Should be fixed in 4.3.0, duplicate of #5221

@Pe-te Pe-te closed this as completed Jun 13, 2020
@toXel
Copy link

toXel commented Oct 26, 2020

Follow-up on this issue: open is also a reserved Kotlin keyword. But it is not written in backticks when generating an enum value called "open" so this is still a problem on Generator version 4.3.0.

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

No branches or pull requests

3 participants