-
Notifications
You must be signed in to change notification settings - Fork 2.3k
evalengine: Fix JSON Path support for same-value ranges. #19020
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[email protected]>
Signed-off-by: Arthur Schreiber <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
| jpMemberAny | ||
| jpArrayLocation | ||
| jpArrayLocationAny | ||
| jpArrayLocationRange |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to add a new json path kind here. Previously offset0 and offset1 were used to distinguish between an array offset and an array range, but this does not work for things like $[0 to 0] or $[last to last]. So I figured adding a separate kind is simpler and cleaner.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19020 +/- ##
==========================================
+ Coverage 69.81% 69.83% +0.02%
==========================================
Files 1610 1610
Lines 215362 215390 +28
==========================================
+ Hits 150358 150427 +69
+ Misses 65004 64963 -41 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
📝 Documentation updates detected! New suggestion: Add changelog entry for JSON Path same-value range fix |
Signed-off-by: Arthur Schreiber <[email protected]>
Description
The JSON Path implementation used by the eval engine did not properly support single index path ranges (like
$[0 to 0]). It also did not support JSON Paths that includedlastat the end of the range when matched against non-array values.This pull request attempts to fix both of these issues.
I think this should be backported? 🤔
Related Issue(s)
Checklist
Deployment Notes
AI Disclosure