diff --git a/hyper-schema.json b/hyper-schema.json index 59658cf6..5d72a263 100644 --- a/hyper-schema.json +++ b/hyper-schema.json @@ -1,59 +1,11 @@ { "$schema": "http://json-schema.org/draft-08/hyper-schema#", - "$id": "http://json-schema.org/draft-08/hyper-schema#", + "$id": "http://json-schema.org/draft-08/hyper-schema", + "$recursiveAnchor": true, + "title": "JSON Hyper-Schema", - "$defs": { - "schemaArray": { - "allOf": [ - { "$ref": "http://json-schema.org/draft-08/schema#/$defs/schemaArray" }, - { - "items": { "$ref": "#" } - } - ] - } - }, - "allOf": [ { "$ref": "http://json-schema.org/draft-08/schema#" } ], + "$ref": "http://json-schema.org/draft-08/schema", "properties": { - "additionalItems": { "$ref": "#" }, - "additionalProperties": { "$ref": "#"}, - "dependentSchemas": { "$ref": "#" }, - "dependencies": { - "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", - "additionalProperties": { - "anyOf": [ - { "$ref": "#" }, - { "type": "array" } - ] - } - }, - "items": { - "anyOf": [ - { "$ref": "#" }, - { "$ref": "#/$defs/schemaArray" } - ] - }, - "$defs": { - "additionalProperties": { "$ref": "#" } - }, - "definitions": { - "$comment": "Renamed to $defs, but retained here to ensure compatibility", - "additionalProperties": { "$ref": "#" } - }, - "patternProperties": { - "additionalProperties": { "$ref": "#" } - }, - "properties": { - "additionalProperties": { "$ref": "#" } - }, - "if": { "$ref": "#" }, - "then": { "$ref": "#" }, - "else": { "$ref": "#" }, - "allOf": { "$ref": "#/$defs/schemaArray" }, - "anyOf": { "$ref": "#/$defs/schemaArray" }, - "oneOf": { "$ref": "#/$defs/schemaArray" }, - "not": { "$ref": "#" }, - "contains": { "$ref": "#" }, - "propertyNames": { "$ref": "#" }, "base": { "type": "string", "format": "uri-template" @@ -61,7 +13,7 @@ "links": { "type": "array", "items": { - "$ref": "http://json-schema.org/draft-08/links#" + "$ref": "http://json-schema.org/draft-08/links" } } }, diff --git a/links.json b/links.json index 04db6ea8..435eecba 100644 --- a/links.json +++ b/links.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-08/hyper-schema#", - "$id": "http://json-schema.org/draft-08/links#", + "$id": "http://json-schema.org/draft-08/links", "title": "Link Description Object", "allOf": [ { "required": [ "rel", "href" ] }, @@ -36,7 +36,7 @@ "format": "uri-template" }, "hrefSchema": { - "$ref": "http://json-schema.org/draft-08/hyper-schema#", + "$recursiveRef": "http://json-schema.org/draft-08/hyper-schema", "default": false }, "templatePointers": { @@ -63,7 +63,7 @@ "type": "string" }, "targetSchema": { - "$ref": "http://json-schema.org/draft-08/hyper-schema#", + "$recursiveRef": "http://json-schema.org/draft-08/hyper-schema", "default": true }, "targetMediaType": { @@ -71,7 +71,7 @@ }, "targetHints": { }, "headerSchema": { - "$ref": "http://json-schema.org/draft-08/hyper-schema#", + "$recursiveRef": "http://json-schema.org/draft-08/hyper-schema", "default": true }, "submissionMediaType": { @@ -79,7 +79,7 @@ "default": "application/json" }, "submissionSchema": { - "$ref": "http://json-schema.org/draft-08/hyper-schema#", + "$recursiveRef": "http://json-schema.org/draft-08/hyper-schema", "default": true }, "$comment": { diff --git a/schema.json b/schema.json index e8fdfd1d..f64d6636 100644 --- a/schema.json +++ b/schema.json @@ -1,12 +1,14 @@ { "$schema": "http://json-schema.org/draft-08/schema#", "$id": "http://json-schema.org/draft-08/schema#", + "$recursiveAnchor": true, + "title": "Core schema meta-schema", "$defs": { "schemaArray": { "type": "array", "minItems": 1, - "items": { "$ref": "#" } + "items": { "$recursiveRef": "#" } }, "nonNegativeInteger": { "type": "integer", @@ -55,13 +57,13 @@ }, "$defs": { "type": "object", - "additionalProperties": { "$ref": "#" }, + "additionalProperties": { "$recursiveRef": "#" }, "default": {} }, "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.", "type": "object", - "additionalProperties": { "$ref": "#" }, + "additionalProperties": { "$recursiveRef": "#" }, "default": {} }, "title": { @@ -101,10 +103,10 @@ "type": "string", "format": "regex" }, - "additionalItems": { "$ref": "#" }, + "additionalItems": { "$recursiveRef": "#" }, "items": { "anyOf": [ - { "$ref": "#" }, + { "$recursiveRef": "#" }, { "$ref": "#/$defs/schemaArray" } ] }, @@ -114,26 +116,26 @@ "type": "boolean", "default": false }, - "contains": { "$ref": "#" }, + "contains": { "$recursiveRef": "#" }, "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" }, "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, "required": { "$ref": "#/$defs/stringArray" }, - "additionalProperties": { "$ref": "#" }, + "additionalProperties": { "$recursiveRef": "#" }, "properties": { "type": "object", - "additionalProperties": { "$ref": "#" }, + "additionalProperties": { "$recursiveRef": "#" }, "default": {} }, "patternProperties": { "type": "object", - "additionalProperties": { "$ref": "#" }, + "additionalProperties": { "$recursiveRef": "#" }, "propertyNames": { "format": "regex" }, "default": {} }, "dependentSchemas": { "type": "object", "additionalProperties": { - "$ref": "#" + "$recursiveRef": "#" } }, "dependentRequired": { @@ -147,12 +149,12 @@ "type": "object", "additionalProperties": { "anyOf": [ - { "$ref": "#" }, + { "$recursiveRef": "#" }, { "$ref": "#/$defs/stringArray" } ] } }, - "propertyNames": { "$ref": "#" }, + "propertyNames": { "$recursiveRef": "#" }, "const": true, "enum": { "type": "array", @@ -174,12 +176,12 @@ "format": { "type": "string" }, "contentMediaType": { "type": "string" }, "contentEncoding": { "type": "string" }, - "if": { "$ref": "#" }, - "then": { "$ref": "#" }, - "else": { "$ref": "#" }, + "if": { "$recursiveRef": "#" }, + "then": { "$recursiveRef": "#" }, + "else": { "$recursiveRef": "#" }, "allOf": { "$ref": "#/$defs/schemaArray" }, "anyOf": { "$ref": "#/$defs/schemaArray" }, "oneOf": { "$ref": "#/$defs/schemaArray" }, - "not": { "$ref": "#" } + "not": { "$recursiveRef": "#" } } }