I am trying to parse below json response in retrofit/gson, specifically this json
{
"Coincheck":{
"BTC":[
"JPY"
]
},
"QuadrigaCX":{
"ETH":[
"CAD",
"BTC"
],
"BTC":[
"USD",
"CAD"
]
}
// ... more data
}
I tried using Map< String, Map< String, List< String>>
public class ExchangeResp
{
Map<String, Map<String, List<String>>> exchanges;
public Map<String, Map<String, List<String>>> getExchanges()
{
return exchanges;
}
}
but I always get response.body() as null. Do I need to create custom json desrializer implementing JsonDeserializer and pass to gson builder?