diff --git a/meta/applicator.json b/meta/applicator.json index 53645d60..ff2cfc2f 100644 --- a/meta/applicator.json +++ b/meta/applicator.json @@ -12,7 +12,10 @@ "prefixItems": { "$ref": "#/$defs/schemaArray" }, "items": { "$dynamicRef": "#meta" }, "contains": { "$dynamicRef": "#meta" }, - "additionalProperties": { "$dynamicRef": "#meta" }, + "additionalProperties": { + "$dynamicRef": "#meta", + "default": {} + }, "properties": { "type": "object", "additionalProperties": { "$dynamicRef": "#meta" }, @@ -26,11 +29,13 @@ }, "dependentSchemas": { "type": "object", - "additionalProperties": { - "$dynamicRef": "#meta" - } + "additionalProperties": { "$dynamicRef": "#meta" }, + "default": {} + }, + "propertyNames": { + "$dynamicRef": "#meta", + "default": {} }, - "propertyNames": { "$dynamicRef": "#meta" }, "if": { "$dynamicRef": "#meta" }, "then": { "$dynamicRef": "#meta" }, "else": { "$dynamicRef": "#meta" }, diff --git a/meta/content.json b/meta/content.json index fc39a966..2f6e056a 100644 --- a/meta/content.json +++ b/meta/content.json @@ -10,8 +10,8 @@ "type": ["object", "boolean"], "properties": { - "contentMediaType": { "type": "string" }, "contentEncoding": { "type": "string" }, + "contentMediaType": { "type": "string" }, "contentSchema": { "$dynamicRef": "#meta" } } } diff --git a/meta/core.json b/meta/core.json index e87bd3ec..7b5758b1 100644 --- a/meta/core.json +++ b/meta/core.json @@ -10,37 +10,18 @@ "type": ["object", "boolean"], "properties": { "$id": { - "type": "string", - "format": "uri-reference", + "$ref": "#/$defs/uriReferenceString", "$comment": "Non-empty fragments not allowed.", "pattern": "^[^#]*#?$" }, - "$schema": { - "type": "string", - "format": "uri" - }, - "$anchor": { - "type": "string", - "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" - }, - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "$dynamicRef": { - "type": "string", - "format": "uri-reference" - }, - "$dynamicAnchor": { - "type": "string", - "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" - }, + "$schema": { "$ref": "#/$defs/uriString" }, + "$ref": { "$ref": "#/$defs/uriReferenceString" }, + "$anchor": { "$ref": "#/$defs/anchorString" }, + "$dynamicRef": { "$ref": "#/$defs/uriReferenceString" }, + "$dynamicAnchor": { "$ref": "#/$defs/anchorString" }, "$vocabulary": { "type": "object", - "propertyNames": { - "type": "string", - "format": "uri" - }, + "propertyNames": { "$ref": "#/$defs/uriString" }, "additionalProperties": { "type": "boolean" } @@ -53,5 +34,19 @@ "additionalProperties": { "$dynamicRef": "#meta" }, "default": {} } + }, + "$defs": { + "anchorString": { + "type": "string", + "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" + }, + "uriString": { + "type": "string", + "format": "uri" + }, + "uriReferenceString": { + "type": "string", + "format": "uri-reference" + } } } diff --git a/meta/validation.json b/meta/validation.json index edb4a301..606b87ba 100644 --- a/meta/validation.json +++ b/meta/validation.json @@ -9,6 +9,22 @@ "title": "Validation vocabulary meta-schema", "type": ["object", "boolean"], "properties": { + "type": { + "anyOf": [ + { "$ref": "#/$defs/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/$defs/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "const": true, + "enum": { + "type": "array", + "items": true + }, "multipleOf": { "type": "number", "exclusiveMinimum": 0 @@ -50,22 +66,6 @@ "additionalProperties": { "$ref": "#/$defs/stringArray" } - }, - "const": true, - "enum": { - "type": "array", - "items": true - }, - "type": { - "anyOf": [ - { "$ref": "#/$defs/simpleTypes" }, - { - "type": "array", - "items": { "$ref": "#/$defs/simpleTypes" }, - "minItems": 1, - "uniqueItems": true - } - ] } }, "$defs": { diff --git a/schema.json b/schema.json index 9235df28..ca910847 100644 --- a/schema.json +++ b/schema.json @@ -22,22 +22,35 @@ {"$ref": "meta/content"} ], "type": ["object", "boolean"], + "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", "properties": { "definitions": { - "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", + "$comment": "\"definitions\" has been replaced by \"$defs\".", "type": "object", "additionalProperties": { "$dynamicRef": "#meta" }, - "default": {} + "default": {}, + "deprecated": true }, "dependencies": { - "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", + "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.", "type": "object", "additionalProperties": { "anyOf": [ { "$dynamicRef": "#meta" }, { "$ref": "meta/validation#/$defs/stringArray" } ] - } + }, + "deprecated": true + }, + "$recursiveAnchor": { + "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".", + "$ref": "meta/core#/$defs/anchorString", + "deprecated": true + }, + "$recursiveRef": { + "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".", + "$ref": "meta/core#/$defs/uriReferenceString", + "deprecated": true } } }