You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing test case for 2+ '&&' operartors in filter #111
The way to get past this issue in that implementation was to do something like this: $.store.book[? @.category == "reference" && (@.author == "Nigel Rees" && @.price == 8.95)]
If you needed more '&&' conditions, you would end up doing:
I wanted to check in before opening a PR if that issue with two '&&'s is expected RFC behavior or not. From messing with a few other RFC9535 implementations, it seems like you should be able to do multiple '&&'s same you can do multiple '||'.
Theory in the issue linked peeked at the Rust version he based his Go implementation off of and noted the rust version did handle 2+ '&&'s. He also noted seeing this oddness but thought it was inherent to the RFC.
If the behavior is to allow multiple &&s, I can add a few test cases to help cover it o/
logical-and-expr = basic-expr *(S "&&" S basic-expr)
; conjunction
; binds more tightly than disjunction
basic-expr = paren-expr /
comparison-expr /
test-expr
paren-expr = [logical-not-op S] "(" S logical-expr S ")"
; parenthesized expression
logical-not-op = "!" ; logical NOT operator
This clearly means that multiple && filter expressions like [?@a && @b && @c] should be supported without explicit brackets. My implementation also supports this. Adding tests to cover this would be great 👍
Reacted by Alexey, David E. Wheeler and Jarangutan
Activity
taimoorzaeem commentedon Oct 12, 2025
According to RFC, we have grammar:
This clearly means that multiple
&&filter expressions like[?@a && @b && @c]should be supported without explicit brackets. My implementation also supports this. Adding tests to cover this would be great 👍Add tests for consecutive ands and ors in filter jsonpath-standard#111
Add tests for consecutive ands and ors in filter jsonpath-standard#111
Add tests for consecutive ands and ors in filter jsonpath-standard#111
Add tests for consecutive ands and ors in filter #111 (#112)
jarangutan commentedon Oct 16, 2025
Resolved with #112