How to get keys from a nested array and check its existance using assertions
Trying to find solution on how we can only just get all the keys from a nested JSON array object and check its existance using assertion? Any pointer will be helpful as i find solutions where we can get keys using KeySet method but it only returns key 1, key 2, key 3, key 4
Expected key values are : key 1, key 2, key2.subKey 1, key2.subkey2, key2.subkey3,key2.subkey4, key 3, key 4
Sample Json object :
{
"id": "XYZ",
"errordetails": null,
"statuscode": 200,
"message": null,
"data": [
{
"key1": 1294,
"key2": [
{
"sub-key1: 0,
"sub-key2": 2360,
},
{
"sub-key3": 0,
"sub-key4": 2820,
}
],
"key3": true,
"key4": "3X2"
}
{
"Key1": 1294,
"key2": [
{
"sub-key1: 0,
"sub-key2": 2360,
},
{
"sub-key3": 0,
"sub-key4": 2820,
}
],
"key3": true,
"key4": "3X2"
}
]
}