quicktype icon indicating copy to clipboard operation
quicktype copied to clipboard

Kotlin enum values cannot be generate uppercase from json schema

Open nick-ikea opened this issue 1 year ago • 1 comments

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()
    }
}

}

nick-ikea avatar Jan 03 '24 14:01 nick-ikea

Hi @nick-ikea, could you help to provide a sample of your input ?

inferrinizzard avatar May 22 '24 14:05 inferrinizzard