-
Notifications
You must be signed in to change notification settings - Fork 38
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
Filters not working intuitively #31
Comments
Another odd example, using contacts JSON below: Fails:
Succeeds:
or
and the JSON Path (Jayway) equivalent is:
So I guess it is the same as that, in that a projection cannot be used within a truthy expression? INPUT JSON:
|
When I test your expressions on jmespath.org I get the same results as with jmespath-java, so I think it's working as intended. The first example I agree is confusing, and I think it has to do with the counter-intuitive way that projections work. You think that if you can do In the second example |
Yes, I get the second one after I looked at it more. The first makes it hard because adding a |
Maybe it is my misunderstanding, but with this data:
With the following query, nothing returns:
a.b[*].c.d[?e == 'foo']
But this does work:
a.b[*].c.d|@[?e == 'foo']
And in JSON Path (JayWay implementation for example):
a.b[*].c.d[?(@.e == "foo")]
is the equivalent.Is this intentional? they seem functionally equivalent but obviously are not. This fails in the playground (JavaScript), but also fails in the Java implementation.
Is this a spec issue? As designed? Common bug in all implementations? Where do we report something like this that seems to be prevalent across all of JMES?
(jmespath/jmespath.test#15)
The text was updated successfully, but these errors were encountered: