The API response looks something like this:
{
"result": [
{
"key": "facility",
"data": {
"food": {
"nm": "Food"
},
"ppeKit": {
"nm": "PPE kit"
},
"transport": {
"nm": "Transport"
}
}
}
]
}
I want to store the data part of the API response to be stored in a data class like below:
data class ResultItem(
val key: String,
val data: String
)
It should be such that for each data selected, I can find its key easily.