Repository navigation
json-path-features #129
Copy link
Copy link
Open
Description
Context
We extracted ~349 JsonPath expression strings from the upstream Jayway JsonPath test suite under .tmp/JsonPath/... and compared them with our current JsonPath test coverage (~48 expressions at the time).
Some Jayway features are legacy (pre-Java-8 era) and should not be copied directly. We still want to track remaining feature gaps so we can decide (with tests) what belongs in this project.
Explicitly Out Of Scope
- Path-embedded aggregate functions such as
$.numbers.avg(),$.sum(),$.min(),$.max(), etc.- Modern Java code should use
JsonPath.query(...)+ Streams. - We provide stream helpers in
json-java21-jsonpath(seeJsonPathStreams) to filter by type and convert values.
- Modern Java code should use
Research Candidates (Not Yet Ruled Out)
-
Regex filters
- Jayway examples:
$[?(@.name =~ /regex/)],$[?(@.name =~ /REGEX/i)] - Questions:
- Do we want
=~at all? If yes, what is the exact regex syntax and escaping rules? - Case-insensitive flag handling (
/i) and other flags.
- Do we want
- Jayway examples:
-
Multi-property selection in brackets
- Examples:
$['a', 'b', 'c'],$.store.book[*]['author', 'isbn'] - Decide semantics: preserve ordering? include missing keys? duplicates?
- Examples:
-
inoperator in filters- Example:
$[?(@.category in ['fiction', 'reference'])] - Decide type rules: strings only? numbers? null handling?
- Example:
-
Special key escaping (quotes, commas, backslashes)
- Examples:
$['key,'],$['key\\,'],$['can\\'t delete'] - Decide escaping rules to match parser/string literal handling.
- Examples:
-
Keys containing dashes/dots (and dot-notation ambiguity)
- Examples:
$.display-price,$['dot.notation'],$..['display-price'] - Ensure property printing/reconstruction stays stable.
- Examples:
-
Deep nested filters (property-paths inside filters)
- Examples:
$[?(@.foo.bar)],$[?(@.parent.child.name)] - Decide supported depth and behavior when intermediate nodes are missing.
- Examples:
Suggested Next Steps
- For each candidate feature:
- Pick a minimal set of JsonPath expressions from the Jayway string catalog.
- Add small, explicit tests in
json-java21-jsonpathfor parsing and evaluation. - Decide whether behavior is Goessner-aligned or a deliberate extension.
- Keep the feature list updated as decisions are made.
Reference
- Goessner JSONPath article: https://goessner.net/articles/JsonPath/
Metadata
Metadata
Assignees
Labels
No labels
Activity
Issue #129 Add JsonPathStreams helpers and stream aggregation docs
Issue #129 Bump CI expected test count
Issue #129 Tighten JsonPath docs and fix reverse slices
Issue #129 Expand README JsonPath example
Issue #129 Keep README user-facing; move agent rules to AGENTS
Issue #129 Keep templates user-focused; AGENTS for contributors
Issue #129 Clarify invasive change guidance
Issue #129 Clarify mvn wrapper policy in AGENTS
Issue #129 Document jsonpath module and module doc policy
Issue #129 Clarify upstream bugfix policy
Json path (#125)
simbo1905 commentedon May 19, 2026
Status at Release 2026.02.05
What's Implemented (235+ tests across 6 test classes)
$$.store.book/$['store'][0]/[-1][0:4:2]/[::-1]$.store.*$..price[0,1]/['a','b'][?(@.isbn)][?(@.price < 10)](==,!=,<,>,<=,>=)[?(@.a && (@.b || !@.c))][(@.length-1)]JsonPathStreams.asDouble(),isNumber(), etc.Research Candidates — Decision Status
=~)$['a','b']already supportedinoperator['key']works; complex escaping not yet defined@.foo.bar)parseCurrentNodePathsupports dotted property paths inside filtersOut of Scope (confirmed)
$.numbers.avg(),$.sum(), etc.) — useJsonPathStreams+ Java Streams instead.Suggested Next Steps
If we want to close this ticket, we should:
@.foo.barpathsTest coverage:
JsonPathGoessnerTest(98 tests),JsonPathFilterEvaluationTest(19 tests),JsonPathParserTest(118 tests), plus 3 additional test classes.