Skip to content
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

Failed to extract an entry from an array generated by a filter #243

Closed
jmlamare opened this issue Jun 30, 2016 · 3 comments
Closed

Failed to extract an entry from an array generated by a filter #243

jmlamare opened this issue Jun 30, 2016 · 3 comments

Comments

@jmlamare
Copy link
Contributor

For Example

The following inputs generate no result
JSON: [{"a":1,"b":"X"},{"a":2,"b":"Y"},{"a":3,"b":"Z"}]
EXPR: $[?(@.a==1)][0]

@ghl3
Copy link

ghl3 commented Aug 3, 2016

For a concrete example:

JsonPath.read("[{\"x\":\"a\"}, {\"x\":\"b\"}]", "[?(@.x == 'a')]")

returns:

[{x=a}]

but

JsonPath.read("[{\"x\":\"a\"}, {\"x\":\"b\"}]", "[?(@.x == 'a')][0]")

returns

[]

We would expect it to return

{"x"="a"}

This appears to happen when you do an index selection directly after a filter.

@lakshan93
Copy link

Are there any workaround to achieve this value?

@kallestenflo
Copy link
Contributor

Duplicate of #272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants