-
Notifications
You must be signed in to change notification settings - Fork 71
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
Negating the filter expression using ! is not working #151
Comments
Also note that when using bracket indexing for the object we're checking, we get an error: QueryJsonPath.new("$[?(!@['pull_request'])]").on(json) 🐞 Actual Result:Traceback (most recent call last):
16: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/enumerable.rb:24:in `each'
15: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/enumerable.rb:26:in `each'
14: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/enumerable.rb:55:in `handle_wildecard'
13: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/enumerable.rb:55:in `each'
12: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/enumerable.rb:63:in `block in handle_wildecard'
11: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/enumerable.rb:108:in `handle_question_mark'
10: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/enumerable.rb:108:in `times'
9: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/enumerable.rb:110:in `block in handle_question_mark'
8: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/enumerable.rb:160:in `process_function_or_literal'
7: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/parser.rb:31:in `parse'
6: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/parser.rb:45:in `construct_expression_map'
5: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/parser.rb:45:in `each_with_index'
4: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/parser.rb:45:in `each'
3: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/parser.rb:49:in `block in construct_expression_map'
2: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/parser.rb:107:in `parse_exp'
1: from /Users/evansalter/.rvm/gems/ruby-2.6.6/gems/jsonpath-1.1.2/lib/jsonpath/parser.rb:107:in `!'
ArgumentError (wrong number of arguments (given 1, expected 0)) Expected Result
I've got a PR to fix this incoming. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample JSON: Response from Github when getting a list of all issues
The response contains two objects, one with a
pull_request
property and the other doesn't have apull_request
property.Bug
The request is to support this scenario
Intent:
Get all objects from sample json data that don't have a
pull_request
propertyQuery
🐞 Actual Result:
Expected Result
Result From Jsonpath.com
Intent:
Get all objects from sample data with the
pull_request
property in the responseQuery
Result from JsonPath
The text was updated successfully, but these errors were encountered: