glideapps / quicktype

Generate types and converters from JSON, Schema, and GraphQL
https://app.quicktype.io
Apache License 2.0
11.93k stars 1.05k forks source link

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

Open nick-ikea opened 7 months ago

nick-ikea commented 7 months ago

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

}

inferrinizzard commented 3 months ago

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