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

Implement top-down matching for JsonPathMatcher #4708

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

knutwannheden
Copy link
Contributor

@knutwannheden knutwannheden commented Nov 24, 2024

The find(Cursor) and matches(Cursor) methods were intended to be used to check if a given leaf node matches the JSON Path expression against a corresponding parent as starting point for the JSON path. As a result the expression had to be evaluated over and over again for each call to these methods, even though the evaluation results returns all matches each time.

This PR updates the implementation so that the match results are stored as a cursor message for the root node against which the expression was matched. Then the matching often only needs to be done once and subsequent find(), and matches() calls will use that cached result.

@timtebeek timtebeek added the enhancement New feature or request label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

MergeYaml giving unexpected results where JSON path value of key includes wildcards
2 participants