Skip to content

MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt…#1542

Open
AvivDavid23 wants to merge 4 commits intomasterfrom
MOD-14664
Open

MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt…#1542
AvivDavid23 wants to merge 4 commits intomasterfrom
MOD-14664

Conversation

@AvivDavid23
Copy link
Copy Markdown
Contributor

@AvivDavid23 AvivDavid23 commented Apr 9, 2026

…er comparisons, Don't evaluate filters on scalar types

  • Allow multi results from filter evaluation
  • Do not evaluate filters on scalar types, according to RFC 9535.

This also fixes #963 and #968


Note

Medium Risk
Changes JSONPath filter semantics to allow multi-result subpaths to participate in comparisons/regex matching and to ignore filters applied to primitive values; this can alter query results and could impact downstream expectations.

Overview
Aligns filter evaluation with RFC 9535 by introducing a NodeList term result for non-singular subpaths (e.g. @.*, @..key) and making >, >=, <, <=, ==, and =~ succeed when any element in the list matches (with != remaining !(==)).

Updates the evaluator to convert multi-match subqueries into NodeList instead of treating them as invalid, and stops applying filter selectors to scalar nodes (arrays/objects only). Expands/adjusts tests to cover wildcard/recursive-descent filter subpaths, regex with NodeLists, and to ensure recursive-descent filtering does not emit duplicate scalar matches.

Reviewed by Cursor Bugbot for commit df6b7cf. Bugbot is set up for automated code reviews on this repo. Configure here.

…er comparisons, Don't evaluate filters on scalar types
@AvivDavid23 AvivDavid23 requested a review from TalBarYakar April 9, 2026 09:09
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 52.27273% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.04%. Comparing base (e99a773) to head (df6b7cf).

Files with missing lines Patch % Lines
json_path/src/json_path.rs 52.27% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1542      +/-   ##
==========================================
- Coverage   75.18%   75.04%   -0.15%     
==========================================
  Files          15       15              
  Lines        4220     4231      +11     
==========================================
+ Hits         3173     3175       +2     
- Misses       1047     1056       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Successfully merging this pull request may close these issues.

JSONPath filter with recursive descent or star from current element doesn't match as expected

1 participant