glideapps / quicktype

Generate types and converters from JSON, Schema, and GraphQL

Home Page:https://app.quicktype.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kotlin enum values cannot be generate uppercase from json schema

nick-ikea opened this issue · 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()
    }
}

}

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