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

Broken support for "or expressions" in filters #14

Closed
elyobo opened this issue Jan 5, 2016 · 3 comments
Closed

Broken support for "or expressions" in filters #14

elyobo opened this issue Jan 5, 2016 · 3 comments

Comments

@elyobo
Copy link

elyobo commented Jan 5, 2016

The specification allows for "or expressions" in filters, but jmespath.rb seems to only have partial support.

require 'jmespath'

# Results in undefined method `empty?' for true:TrueClass, should match
JMESPath.search('[?foo || bar]', [{foo: true, bar: false}])

# Results in empty an empty array, should match
JMESPath.search("[?foo == 'foo' || bar == 'foo']", [{foo: "foo", bar: "bar"}])

# Results in empty an empty array, should match, trying different delimiters
JMESPath.search('[?foo == `"foo"` || bar == `"foo"`]', [{foo: "foo", bar: "bar"}])
``
@iconara
Copy link
Contributor

iconara commented Jan 11, 2016

The first case is fixed by #15

@elyobo
Copy link
Author

elyobo commented Jan 11, 2016

Thanks @iconara

@trevorrowe
Copy link
Contributor

#15 has been merged and there have been various other expression and comparison fixes.

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

3 participants