From 2f6925852811d40163fe58154906cdd2d6a885ce Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 23 Apr 2026 06:49:06 +0000 Subject: [PATCH] Add json-pointer format to statementPointerTarget 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. --- schema/statement.json | 3 ++- .../invalid-statements/expected_errors.csv | 1 + ...tations_statementPointerTarget_format.json | 21 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 tests/data/invalid-statements/statement_annotations_statementPointerTarget_format.json diff --git a/schema/statement.json b/schema/statement.json index b59bbdb9..2a01b9de 100644 --- a/schema/statement.json +++ b/schema/statement.json @@ -226,7 +226,8 @@ "statementPointerTarget": { "title": "Statement Fragment Pointer", "description": "An RFC6901 JSON Pointer (https://tools.ietf.org/html/rfc6901) describing the target fragment of the statement that this Annotation applies to, starting from the root of the Statement. An empty string (\"\") indicates that the Annotation applies to the whole Statement.", - "type": "string" + "type": "string", + "format": "json-pointer" }, "creationDate": { "title": "Creation Date", diff --git a/tests/data/invalid-statements/expected_errors.csv b/tests/data/invalid-statements/expected_errors.csv index bb954f8c..550562fd 100644 --- a/tests/data/invalid-statements/expected_errors.csv +++ b/tests/data/invalid-statements/expected_errors.csv @@ -15,6 +15,7 @@ person_names_fullName_missing.json,required,$[0].recordDetails.names[0],fullName person_taxResidencies_no_object.json,type,$[0].recordDetails.taxResidencies,taxResidencies person_addresses_no_array.json,type,$[0].recordDetails.addresses,addresses statement_annotations_statementPointerTarget_type.json,type,$[0].annotations[0].statementPointerTarget,statementPointerTarget +statement_annotations_statementPointerTarget_format.json,format,$[0].annotations[0].statementPointerTarget,statementPointerTarget entity_address_not_string.json,type,$[0].recordDetails.addresses[0].address,address entity_postcode_not_string.json,type,$[0].recordDetails.addresses[0].postCode,postCode entity_address_country_name_not_string.json,type,$[0].recordDetails.addresses[0].country.name,name diff --git a/tests/data/invalid-statements/statement_annotations_statementPointerTarget_format.json b/tests/data/invalid-statements/statement_annotations_statementPointerTarget_format.json new file mode 100644 index 00000000..e43234c6 --- /dev/null +++ b/tests/data/invalid-statements/statement_annotations_statementPointerTarget_format.json @@ -0,0 +1,21 @@ +[ + { + "statementId": "2f7bf9370f1254068e5e946df067d07d", + "declarationSubject": "xyz", + "statementDate": "2017-11-18", + "annotations": [ + { + "statementPointerTarget": "recordDetails/interestedParty", + "motivation": "identifying" + } + ], + "recordId": "123", + "recordType": "entity", + "recordDetails": { + "entityType": { + "type": "unknownEntity" + }, + "isComponent": false + } + } +]