Skip to content

Add json-pointer format to statementPointerTarget#758

Open
StephenAbbott wants to merge 1 commit intomainfrom
claude/fix-707-json-pointer-format
Open

Add json-pointer format to statementPointerTarget#758
StephenAbbott wants to merge 1 commit intomainfrom
claude/fix-707-json-pointer-format

Conversation

@StephenAbbott
Copy link
Copy Markdown
Collaborator

Summary

Fixes #707.

The statementPointerTarget property on the Annotation object is described as an RFC6901 JSON Pointer but the schema only constrained it to type: string. This adds "format": "json-pointer" so validators reject values that are not well-formed pointers (e.g. missing leading / or containing invalid ~ escapes).

Change in schema/statement.json:

         "statementPointerTarget": {
           "title": "Statement Fragment Pointer",
           "description": "An RFC6901 JSON Pointer ...",
-          "type": "string"
+          "type": "string",
+          "format": "json-pointer"
         },

Test plan

  • Added tests/data/invalid-statements/statement_annotations_statementPointerTarget_format.json with an invalid pointer (missing leading /)
  • Added matching row to tests/data/invalid-statements/expected_errors.csv
  • pytest tests/test_data.py — new test passes; no new failures (pre-existing 12 format-related failures on main in the local sandbox are environmental and unchanged here)
  • All existing valid fixtures use well-formed pointers ("", /recordDetails/..., /statementDate) so none break under the new constraint

https://claude.ai/code/session_019ksAaAodXk1wNCLcuEVkXC


Generated by Claude Code

The statementPointerTarget property on the Annotation object is described
as an RFC6901 JSON Pointer. Adding "format": "json-pointer" lets validators
reject strings that are not well-formed pointers.

Also adds a test fixture exercising the new format constraint.

Fixes #707.
@StephenAbbott StephenAbbott requested a review from kd-ods April 23, 2026 06:59
@kd-ods
Copy link
Copy Markdown
Collaborator

kd-ods commented Apr 23, 2026

Thanks, @StephenAbbott . This edit will require some work our end so I'll tag it as a good PR to start with if there's a future round of development on the schema.

@kd-ods kd-ods added Validation jsonschema Related to the JSON Schema validation starter issue For post 0.4 round of dev labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jsonschema Related to the JSON Schema validation starter issue For post 0.4 round of dev Validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add string format:"json-pointer" to statementPointerTarget property

3 participants