Draft
Implement RFC 6901 JSON Pointer as json-java21-jsonpointer module#149
Conversation
Add a new Maven module json-java21-jsonpointer that implements RFC 6901 JSON Pointer. It depends only on the sibling json-java21 library. Public API: JsonPointer.parse(String) – validates syntax, returns JsonPointer JsonPointer.resolve(JsonValue) – resolves or throws JsonPointerResolutionException JsonPointer.exists(JsonValue) – returns boolean JsonPointer.tokens() – decoded reference token list JsonPointer.toString() – canonical pointer string (round-trips) JsonPointerSyntaxException – bad pointer syntax JsonPointerResolutionException – pointer cannot be resolved against a document All 12 RFC 6901 §5 example table entries pass. 51 unit tests pass. Compiler configured with -Xlint:all -Werror; zero warnings. To verify: mvn -pl json-java21-jsonpointer -am -Djava.util.logging.ConsoleHandler.level=INFO test
…e0DecodesTildeInKey
Copilot created this pull request from a session on behalf of
simbo1905
July 9, 2026 16:08
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new
json-java21-jsonpointermodule implementing RFC 6901 JSON Pointer — the exact-address path syntax used by JSON Patch. Single runtime dependency: siblingjson-java21.What changed
New module:
json-java21-jsonpointerJsonPointer—parse(),resolve(),exists(),tokens(),toString()JsonPointerSyntaxException— malformed pointer (no leading/, invalid~escape)JsonPointerResolutionException— pointer valid but target absent (missing key, OOB index, non-numeric array token, traversal into primitive)JsonPointerLoggingConfig— standard JUL logging base for tests, matching sibling modulesRFC 6901 §5 example table — all 12 entries covered:
Key behaviours:
~1→/first,~0→~second (so~01→~1)-token correctly not resolvable under RFC 6901 (RFC 6902 append sentinel only)"01") rejected per RFC 6901 §4parse(p).toString()always round-tripsModule structure mirrors
json-java21-jsonpathandjson-java21-jtdexactly — samepom.xmlshape, compiler flags (-Xlint:all -Werror), package convention, and doc style (JEP 467///).Why this change is needed
JSON Pointer is the path/address syntax used by JSON Patch (RFC 6902) and needed as a foundation for future patch support. It is also useful standalone for navigating JSON documents by exact address.
How were these changes tested
51 unit tests covering: all RFC §5 example table entries, escape ordering edge cases,
tokens()/exists()/toString()accessors, syntax rejection, resolution failures (missing key, OOB, non-numeric token, primitive traversal,-token, leading-zero index), and nested document resolution via parameterized cases.Checklist
CODING_STYLE_LLM.mdconvensionsAGENTS.mdupdated if appropriate