How can we convert the nested json to nested hashmap without creating the pojo classes.
{
"IdeskFields": [
{
"fieldName": "CLIENT_TAX_TYPE_ID",
"values": [
{
"key": "dataType",
"value": "Integer"
},
{
"key": "CLIENT_TAX_TYPE_VAT",
"value": "2"
},
{
"key": "CLIENT_TAX_TYPE_GST",
"value": "8"
},
{
"key": "CLIENT_TAX_TYPE_Tax",
"value": "9"
}
]
}
]
}
Need to be converted to Map<String, Map<String, String>> map
Map<String, Map<String, String>>. If you observe, the root element is of typeList. Then this list has specific object. This object internally has values of typeMap. The the most apt solution would be to convert the json toMap<String, Object>