I am having to trouble to retrieve value if parent element can be JSONArray as well as JSONObject. For that I used Deepcopy syntax to retrieve it. Now Problem is am getting additional values if child attribute exists in Inner Array also.
Eg: JpathExpression:
$.store..book..innerBook..category
Result is :
[
"innerReference1",
"innerBook1Ref1",
"innerReference2"
]
Example 1 Expected Result is :
[
"innerReference1",
"innerReference2"
]
Example 1:
{
"store": {
"book": [
{
"innerBook": [
{
"category": "innerReference1",
"author": "Nigel Rees",
"innerBook1": [
{
"category": "innerBook1Ref1"
}
]
},
{
"category": "innerReference2",
"author": "Nigel Rees"
}
]
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
},
"expensive": 10
}
Example 2:
{
"store": {
"book": [
{
"innerBook":
{
"category": "innerReference1",
"author": "Nigel Rees",
"innerBook1": [
{
"category": "innerBook1Ref1"
}
]
}
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
},
"expensive": 10
}
Example 2 Expected Result is :
[
"innerReference1"
]