-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any chance of adding recursive descent support? #130
Comments
I have no plans at this time, but I think it's an interesting idea. Perhaps using three dots followed by the path. |
I'm closing for now, but please reopen if you further ideas. |
@tidwall closed, because you aren't interested in implementing it, or closed because you would like more input on how it'd be implemented? XPath, for XML, has wildcard path support with the A real-life use-case is the Linux window manager, Support for some sort of wildcard syntax ( |
This commit adds the "@dig" modifier, which allows for searching for values in deep or arbitrarily nested json documents For example, using the following json: ``` { "something": { "anything": { "abcdefg": { "finally": { "important": { "secret": "password" } } } } } } ``` ``` @dig:secret -> ["password"] ``` See #130
I just added the { "something": {
"anything": {
"abcdefg": {
"finally": {
"important": {
"secret": "password"
}
}
}
}
}
}
I hope you find this helpful. |
As detailed at https://goessner.net/articles/JsonPath/ - recursive descent allows specifying elements without needing to give their whole path.
The syntax clashes with the JSON Lines syntax, but it could be implemented differently.
It is very helpful for deeply nested elements where it is hard to get a whole path; as a simple example:
With recursive descent you could do
$..secret
and get[ "password"]
as the output.Are there plans, or appetite, to support such a feature?
Thanks!
The text was updated successfully, but these errors were encountered: