How can I parse JSON using GSON with variable object names? The "routes" objects has the same structure, but different name. It has many different names because it reflects to travel lines. I'm trying to read it directly to Java class (Android, Retrofit), but I wouldn't create single class for all travel lines in Budapest. Is it possible to read it somehow?
{
"version": 2,
"status": "OK",
"code": 200,
"text": "OK",
"currentTime": 1448881433747,
"data": {
"limitExceeded": false,
"references": {
"routes": {
"BKK_9630": {
"id": "BKK_9630",
"shortName": "963",
"longName": null,
"description": "Hűvösvölgy | Nagykovácsi, Tisza István tér",
"type": "BUS",
"url": null,
"color": "1E1E1E",
"textColor": "FFFFFF",
"agencyId": "BKK",
"bikesAllowed": false
},
"BKK_0630": {
"id": "BKK_0630",
"shortName": "63",
"longName": null,
"description": "Hűvösvölgy | Nagykovácsi, Tisza István tér",
"type": "BUS",
"url": null,
"color": "009FE3",
"textColor": "FFFFFF",
"agencyId": "BKK",
"bikesAllowed": false
}
},
"trips": {},
"alerts": {}
}
}
}
The full JSON response: http://futar.bkk.hu/bkk-utvonaltervezo-api/ws/otp/api/where/search.json?query=Erd%C3%A9szh%C3%A1z
Thanks in advance!