Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor GetByJsonPath and add batch processing for multiple JSON paths #97

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

yangzhg
Copy link

@yangzhg yangzhg commented Sep 25, 2024

  • Refactored the GetByJsonPath function by extracting the core logic into a new GetByJsonPathInternal method to avoid redundant DOM parsing.
  • Added GetByJsonPaths, a new function that supports querying multiple JSON paths in a single operation, which improves performance by parsing the JSON document only once.
  • Updated tests:
    • Added ValidBatchOK utility to validate the results of batch processing.
    • Introduced new test cases (WildCardBatch and BadBatch) to ensure correct handling of valid and invalid JSON with multiple paths.
  • Minor formatting improvements and inclusion of the <algorithm> header.

Zhengguo Yang and others added 2 commits September 25, 2024 15:17
- Refactored the `GetByJsonPath` function by extracting the core logic into a new `GetByJsonPathInternal` method to avoid redundant DOM parsing.
- Added `GetByJsonPaths`, a new function that supports querying multiple JSON paths in a single operation, which improves performance by parsing the JSON document only once.
- Updated tests:
  - Added `ValidBatchOK` utility to validate the results of batch processing.
  - Introduced new test cases (`WildCardBatch` and `BadBatch`) to ensure correct handling of valid and invalid JSON with multiple paths.
- Minor formatting improvements and inclusion of the `<algorithm>` header.
@liuq19 liuq19 merged commit d3fa066 into bytedance:dev/jsonpath Sep 25, 2024
22 of 23 checks passed
@yangzhg yangzhg deleted the add_batch branch September 25, 2024 08:57
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants