I have the following JSON schema from the response of an API which can either be :
{
"meta": {
"someData": " "
},
"A": [
{
"code": 123,
"id": "string",
"data": {}
},
{
"code": 123,
"id": "string",
"data": {}
}
]
}
OR
{
"meta": {
"someData": " "
},
"B": [
{
"code": 123,
"id": "string",
"data": {}
},
{
"code": 123,
"id": "string",
"data": {}
}
]
}
How do I get obtain just the date from the list or either property A
or property B
?
I expect output to be something like:
A[0].data = {}
A[1].data = {}
OR
B[0].data = {}
B[1].data = {}
And I want to store the data property, which is an object with variable number of sub properties in a map.