The JSON I am trying to parse looks like this:
{
"date": "2018-10-18",
"rates": {
"BGN": 1.6999565406,
"CAD": 1.3045632334,
"BRL": 3.6899608866
...
}
}
I do not know what K-V pairs would be present in the rates object. I want to parse such a JSON structure using GSON, so I created this model class
public class Rates {
public Date date;
}
How do I extract the underlying K-V pairs inside rates using GSON?
PS. My question is different from this as that guy had a varied top-level object. For me, the underlying key-value pairs are dynamic and not known