diff --git a/test-schema.json b/test-schema.json index 83393162..0087c5e3 100644 --- a/test-schema.json +++ b/test-schema.json @@ -27,6 +27,69 @@ "type": "array", "items": { "$ref": "#/$defs/test" }, "minItems": 1 + }, + "specification":{ + "description": "A reference to a specification document which defines the behavior tested by this test case. Typically this should be a JSON Schema specification document, though in cases where the JSON Schema specification points to another RFC it should contain *both* the portion of the JSON Schema specification which indicates what RFC (and section) to follow as *well* as information on where in that specification the behavior is specified.", + + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items":{ + "properties": { + "core": { + "description": "A section in official JSON Schema core drafts", + "url": "https://json-schema.org/specification-links", + "pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$", + "type":"string" + }, + "validation": { + "description": "A section in official JSON Schema validation drafts", + "url": "https://json-schema.org/specification-links", + "pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$", + "type":"string" + }, + "ecma262": { + "description": "A section in official ECMA 262 specification for defining regular expressions", + "url": "https://262.ecma-international.org/", + "pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$", + "type":"string" + }, + "perl5": { + "description": "A section name in Perl documentation for defining regular expressions", + "url": "https://perldoc.perl.org/perlre", + "type":"string" + }, + "quote": { + "description": "Quote describing the test case", + "type":"string" + } + }, + "patternProperties": { + "^rfc\\d+$": { + "description": "A section in official RFC for the given rfc number", + "url": "https://www.rfc-editor.org/", + "pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$", + "type":"string" + }, + "^iso\\d+$": { + "description": "A section in official ISO for the given iso number", + "pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$", + "type": "string" + } + }, + "additionalProperties": { "type": "string" }, + "minProperties": 1, + "propertyNames": { + "oneOf": [ + { + "pattern": "^((iso)|(rfc))[0-9]+$" + }, + { + "enum": [ "core", "validation", "ecma262", "perl5", "quote" ] + } + ] + } + } } }, "additionalProperties": false diff --git a/tests/draft2020-12/additionalProperties.json b/tests/draft2020-12/additionalProperties.json index 29e69c13..cae4d3c7 100644 --- a/tests/draft2020-12/additionalProperties.json +++ b/tests/draft2020-12/additionalProperties.json @@ -2,6 +2,7 @@ { "description": "additionalProperties being false does not allow other properties", + "specification": [ { "core":"10.3.2.3", "quote": "The value of \"additionalProperties\" MUST be a valid JSON Schema. Boolean \"false\" forbids everything." } ], "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": {"foo": {}, "bar": {}}, @@ -43,6 +44,7 @@ }, { "description": "non-ASCII pattern with additionalProperties", + "specification": [ { "core":"10.3.2.3"} ], "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "patternProperties": {"^รก": {}}, @@ -63,6 +65,7 @@ }, { "description": "additionalProperties with schema", + "specification": [ { "core":"10.3.2.3", "quote": "The value of \"additionalProperties\" MUST be a valid JSON Schema." } ], "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": {"foo": {}, "bar": {}}, @@ -87,8 +90,8 @@ ] }, { - "description": - "additionalProperties can exist by itself", + "description": "additionalProperties can exist by itself", + "specification": [ { "core":"10.3.2.3", "quote": "With no other applicator applying to object instances. This validates all the instance values irrespective of their property names" } ], "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": {"type": "boolean"} @@ -108,6 +111,7 @@ }, { "description": "additionalProperties are allowed by default", + "specification": [ { "core":"10.3.2.3", "quote": "Omitting this keyword has the same assertion behavior as an empty schema." } ], "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": {"foo": {}, "bar": {}} @@ -122,6 +126,7 @@ }, { "description": "additionalProperties does not look in applicators", + "specification":[ { "core": "10.2", "quote": "Subschemas of applicator keywords evaluate the instance completely independently such that the results of one such subschema MUST NOT impact the results of sibling subschemas." } ], "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "allOf": [ @@ -139,6 +144,7 @@ }, { "description": "additionalProperties with null valued instance properties", + "specification": [ { "core":"10.3.2.3" } ], "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": {