{
"dataObject": [
{
"id": 263626,
"role": {
"id": 12054,
"name": "Edit",
"description": ""
},
"resource": {
"id": 5756,
"type": "resource"
}
},
{
"id": 263364,
"role": {
"id": 12054,
"name": "Edit",
"description": ""
},
"resource": {
"id": 5728,
"type": "resource"
}
}
]
}
I have a JSON object which looks like this. I need to extract the json object from dataObject
which has name:Edit
and id:5756
.
How can I achieve this using JSON path?
Tried $..[?(@.name="Edit", @.id=5756)]
which didn't work.
Java code:
JsonPath.parse(json).read("$..[?(@.name='Edit'), (@.id=5756)]")