I have below json response. Below response for layer2 object array there can be x number of items
{"data": {
"layer1": {
"layer2": [
{
"item1": "result1",
"item2": "result2"
},
{
"item1": "result3",
"item2": "result4"
}
]
}
}
}
My requirement is if I know value of one element (e.g. item1
value result4), How do I get the correspondence item value of item1
which is result3.
I have the below code where I can retrieve the object array. Is that possible to retrieve above with below output.
List<Object> actual = response.jsonPath().getList("data.layer1.layer2");