Assume that I get this JSon Response from webservice:
{
"id":13,
"name":"Alireza",
"required_id":"14",
"all_friends_id_and_name":{
"28":"Hassan",
"21":"Mohammad",
"68":"Ali",
"14":"Taha",
"96":"Darya"
}
}
In this response required_id
value specifies that I need a friend name with id 14, so in all_friends_id_and_name
object I should get the value of "14" (Taha) and use it in my app.
I'm using retrofit2 and gson libraries.
How to get property of an object which has non-fixed keys?