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 enum values cannot be generate uppercase from json schema #2461

Open
nick-ikea opened this issue Jan 3, 2024 · 0 comments
Open

Kotlin enum values cannot be generate uppercase from json schema #2461

nick-ikea opened this issue Jan 3, 2024 · 0 comments

Comments

@nick-ikea
Copy link

Here is the result of generated enum keys:

enum class WeightUomCodeType(val value: String) {
Grm("GRM"),
Kgm("KGM"),
Lbr("LBR"),
Stn("STN"),
Tne("TNE");

companion object {
    fun fromValue(value: String): WeightUomCodeType = when (value) {
        "GRM" -> Grm
        "KGM" -> Kgm
        "LBR" -> Lbr
        "STN" -> Stn
        "TNE" -> Tne
        else  -> throw IllegalArgumentException()
    }
}

}

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

1 participant