Here, I'm trying to parse this JSON Object into model. But I'm stuck here with the dynamic field names. Here is the example of the JSON Object
{
"1": {
"state": {
"on": false,
"bri": 0,
"hue": 0,
"sat": 0,
"effect": "none",
"xy": [
0,
0
],
"ct": 0,
"alert": "none",
"colormode": "hs",
"reachable": false
},
"type": "Extended color light",
"name": "Hue Lamp 1",
"modelid": "LCT001",
"manufacturername": "Philips",
"uniqueid": "00:17:88:01:00:f4:5a:aa-0b",
"swversion": "5.23.1.13452"
},
"2": {
"state": {
"on": false,
"bri": 254,
"hue": 8000,
"sat": 200,
"effect": "none",
"xy": [
0.5469,
0.3819
],
"ct": 500,
"alert": "none",
"colormode": "hs",
"reachable": true
},
"type": "Extended color light",
"name": "Hue Lamp 2",
"modelid": "LCT001",
"manufacturername": "Philips",
"uniqueid": "00:17:88:01:00:f4:5c:55-0b",
"swversion": "5.23.1.13452"
}
}
There are these field "1","2" and so on. How to parse this into model ? Can anybody help ?
Updated : All i want to achieve is getting this "1", "2" key value and the "name" field value in it. Thanks before !