I have tried to create GPath expression with filter criteria to return "my-notes" in list of object when '"my-type"' is SPECIAL
like : '"data.my-node.nodes.findAll{it.'my-type'=='GENERAL'}.'my-nodes'"'
but unable to get response from the below json
{
"data": {"my-node": [
{
"nodes": [ {
"my-nodes": [{"my-note": "abcdefg"}],
"my-type": "GENERAL"
}],
"my-instruction": null
},
{
"nodes": [ {
"my-nodes": [{"my-note": "abcdefg"}],
"my-type": "SPECIAL"
}],
"my-instruction": null
},
{
"nodes": [ {
"my-nodes": [{"my-note": "oiugitoirtuhou"}],
"my-type": "SPECIAL"
}],
"my-instruction": null
},
{
"nodes": [ {
"my-nodes": [{"my-note": "ifuoirjhihj"}],
"my-type": "SPECIAL"
}],
"my-instruction": null
},
{
"nodes": [ {
"my-nodes": [{"my-note": "idfgdiufgdhsfuihdf"}],
"my-type": "SPECIAL"
}],
"my-instruction": null
},
{
"nodes": [ {
"my-nodes": [{"my-note": "iydfgsigdfgdgidsf"}],
"my-type": "SPECIAL"
}],
"my-instruction": null
}
]}
}
The GPath syntax is
['key-abc']for keys contain special characters.flatten()method to make 2D array to 1D array.