quicktype
quicktype copied to clipboard
Kotlin enum values cannot be generate uppercase from json schema
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 ?