您好我有以下数据类
data class EntryField(
val name: String,
val type: String,
val label: String,
val values: HashMap<String, String>,
)
我希望JSON可以像这样(对于值部分)
{ "values": {
"7": "40214 - cos of rev. Coffee\/Tea",
"14": "40215 - cos of rev. Softdrinks",
"15": "40224 - cos. of rev. Wines",
"6": "40225 - cos of rev. Beer",
"10": "40226 - cos of rev. Liquor\/Spirit",
"9": "40400 - cos of rev. Flowers",
"13": "40403 - cos of rev. shop",
"11": "40405 - cos of rev. Other",
"8": "40500 - cos of rev. Excursions" }
}
但是,这些项目可能更多或更少,并且具有不同的键/值对。我该如何解析这些?像我上面那样设置一个hashmap并不起作用。