json-lenses
json-lenses copied to clipboard
Support recursive descent JsonPath syntax (and lens)
Hi ,
I have a scenario in my application , where i have to recusrively get all the data, and i tried to use the jsonPath $.store.book[*].subBooks[*]..author
as mentioned in http://goessner.net/articles/JsonPath/ . But i am getting an error while parsing. I tested the same using some online parsers and it is working fine. I would like to know if this is the right syntax to be used in JsonLenses. Please let me know if am missing some thing.
{
"store": {
"book": [
{ "category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95,
"subBooks": [
{ "category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99,
"isbn": "0-553-21311-3",
"subBooks": [
{ "category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99,
"isbn": "0-553-21311-3"
}
]
}
]
},
{ "category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99,
"isbn": "0-553-21311-3"
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
}
}
Regards Johns
Hi @johnspaul, yes that's correct, recursive decent is currently not supported. IIRC neither in json path nor in json-lenses themselves.