Skip to content

Add JsonPath module with AST parser and evaluator #121

@cursor

Description

@cursor

Add a new Maven module implementing JsonPath (Goessner)

Goal

  • Add a new Maven module (Java 21) that implements JsonPath as described by Stefan Goessner.
  • No runtime dependencies outside java.base (and the existing json-java21 core module).
  • Parse JsonPath strings into a custom AST.
  • Evaluate JsonPath AST against a JSON document parsed by the existing jdk.sandbox.java.util.json API.
  • Do NOT parse JSON strings in JsonPath (core library already handles parsing).

Requirements

  • Pure Java 21, functional/data-oriented style (records + sealed interfaces).
  • No external libraries at runtime.
  • TDD: add unit tests for every example on https://goessner.net/articles/JsonPath/index.html and implement incrementally.
  • Keep behavior aligned with the article examples (selectors, recursion, wildcards, unions, slices, filters).

Acceptance

  • New module builds in the multi-module Maven build.
  • Tests cover all article examples.
  • Public API includes a JsonPath.parse(String) (or equivalent) returning an AST-backed compiled expression and an evaluator over JsonValue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions