-
Notifications
You must be signed in to change notification settings - Fork 37
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
Examples from https://goessner.net/articles/JsonPath/ don't work #8
Comments
No problem. Jsonpath itself doesn't contain a script language. The examples from goessner use java script (@.length-1)] and (@.price<10). This lib does not include javascribt but it is build in a way that it can be extended. So you can include a scripting language. Take a look at the gval example. It includes the expression language gval https://github.com/PaesslerAG/gval and is able to evaluate minus and smaller than operators. |
I should probably include this to the package description. |
Thanks! That makes sense.
I realize this questions is probably better suited for gval, but: |
I haven't implemented a === or a nil / null constant. If you're interessted feel free to implement it 😃 |
I'll try that! Thanks for putting up with me :) |
Hi,
sorry for opening another issue so soon after the first one. I took a few examples off https://goessner.net/articles/JsonPath/index.html#e3 but can't get them to work.
Example code:
Will print an empty result.
Other results using the example expressions:
$..book[-1:]
works$..book[(@.length-1)]
leads toparsing error: $..book[(@.length-1)] :1:18 - 1:19 unexpected "-" while scanning parentheses expected ")"
$..book[?(@.price<10)]
leads toparsing error: $..book[?(@.price<10)] :1:18 - 1:19 unexpected "<" while scanning parentheses expected ")"
#1 suggests that expressions containing
[?(@.foo)]
should work, but I can't reproduce that.Does your syntax differ from https://goessner.net/articles/JsonPath/ ?
The text was updated successfully, but these errors were encountered: