diff --git a/meta/applicator.json b/meta/applicator.json index 1b2f8c2e..db15f364 100644 --- a/meta/applicator.json +++ b/meta/applicator.json @@ -1,5 +1,5 @@ { - "$schema": "https://json-schema.org/draft/next/schema", + "$schema": "https://json-schema.org/draft/next/meta/vocabulary", "$id": "https://json-schema.org/draft/next/meta/applicator", "$vocabulary": { "https://json-schema.org/draft/next/vocab/applicator": true @@ -47,11 +47,103 @@ "oneOf": { "$ref": "#/$defs/schemaArray" }, "not": { "$dynamicRef": "#meta" } }, + "applicators": { + "prefixItems": "arrayChild", + "items": "arrayChild", + "contains": [ "objectChild", "arrayChild" ], + "additionalProperties": "objectChild", + "properties": "objectChild", + "patternProperties": "objectChild", + "dependentSchemas": "inPlace", + "propertyDependencies": "inPlace", + "propertyNames": "objectChild", + "if": "inPlace", + "then": "inPlace", + "else": "inPlace", + "allOf": "inPlace", + "anyOf": "inPlace", + "oneOf": "inPlace", + "not": "inPlace" + }, + "assertions": [ + "prefixItems", + "items", + "contains", + "additionalProperties", + "properties", + "patternProperties", + "dependentSchemas", + "propertyDependencies", + "propertyNames", + "then", + "else", + "allOf", + "anyOf", + "oneOf", + "not" + ], + "annotations": { + "prefixItems": { + "kind": [ "producer", "collector" ], + "producedValue": { + "oneOf": [ + { "$ref": "#/$defs/nonNegativeInteger" }, + { "type": "boolean" } + ] + } + }, + "items": { + "kind": [ "producer", "collector" ], + "producedValue": { "const": true } + }, + "contains": { + "kind": [ "producer", "collector" ], + "producedValue": { + "type": "array", + "items": { "$ref": "#/$defs/nonNegativeInteger" } + } + }, + "additionalProperties": { + "kind": [ "producer", "collector" ], + "producedValue": { + "type": "array", + "items": { "type": "string" } + } + }, + "properties": { + "kind": [ "producer", "collector" ], + "producedValue": { + "type": "array", + "items": { "type": "string" } + } + }, + "patternProperties": { + "kind": [ "producer", "collector" ], + "producedValue": { + "type": "array", + "items": { "type": "string" } + } + }, + "dependentSchemas": { "kind": "collector" }, + "propertyDependencies": { "kind": "collector" }, + "propertyNames": { "kind": "collector" }, + "if": { "kind": "collector" }, + "then": { "kind": "collector" }, + "else": { "kind": "collector" }, + "allOf": { "kind": "collector" }, + "anyOf": { "kind": "collector" }, + "oneOf": { "kind": "collector" }, + "not": { "kind": "collector" } + }, "$defs": { "schemaArray": { "type": "array", "minItems": 1, "items": { "$dynamicRef": "#meta" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 } } } diff --git a/meta/content.json b/meta/content.json index 2c29ee50..32295cde 100644 --- a/meta/content.json +++ b/meta/content.json @@ -1,5 +1,5 @@ { - "$schema": "https://json-schema.org/draft/next/schema", + "$schema": "https://json-schema.org/draft/next/meta/vocabulary", "$id": "https://json-schema.org/draft/next/meta/content", "$vocabulary": { "https://json-schema.org/draft/next/vocab/content": true @@ -13,5 +13,10 @@ "contentEncoding": { "type": "string" }, "contentMediaType": { "type": "string" }, "contentSchema": { "$dynamicRef": "#meta" } + }, + "annotations": { + "contentEncoding": { "kind": "producer" }, + "contentMediaType": { "kind": "producer" }, + "contentSchema": { "kind": "producer" } } } diff --git a/meta/format-annotation.json b/meta/format-annotation.json index 562f78f8..a13d6650 100644 --- a/meta/format-annotation.json +++ b/meta/format-annotation.json @@ -1,5 +1,5 @@ { - "$schema": "https://json-schema.org/draft/next/schema", + "$schema": "https://json-schema.org/draft/next/meta/vocabulary", "$id": "https://json-schema.org/draft/next/meta/format-annotation", "$vocabulary": { "https://json-schema.org/draft/next/vocab/format-annotation": true @@ -10,5 +10,8 @@ "type": ["object", "boolean"], "properties": { "format": { "type": "string" } + }, + "annotations": { + "format": { "kind": "producer" } } } diff --git a/meta/format-assertion.json b/meta/format-assertion.json index d60ead96..8730c532 100644 --- a/meta/format-assertion.json +++ b/meta/format-assertion.json @@ -1,5 +1,5 @@ { - "$schema": "https://json-schema.org/draft/next/schema", + "$schema": "https://json-schema.org/draft/next/meta/vocabulary", "$id": "https://json-schema.org/draft/next/meta/format-assertion", "$vocabulary": { "https://json-schema.org/draft/next/vocab/format-assertion": true @@ -10,5 +10,9 @@ "type": ["object", "boolean"], "properties": { "format": { "type": "string" } + }, + "assertions": [ "format" ], + "annotations": { + "format": { "kind": "producer" } } } diff --git a/meta/meta-data.json b/meta/meta-data.json index 345a6916..a4aa8386 100644 --- a/meta/meta-data.json +++ b/meta/meta-data.json @@ -1,5 +1,5 @@ { - "$schema": "https://json-schema.org/draft/next/schema", + "$schema": "https://json-schema.org/draft/next/meta/vocabulary", "$id": "https://json-schema.org/draft/next/meta/meta-data", "$vocabulary": { "https://json-schema.org/draft/next/vocab/meta-data": true @@ -33,5 +33,14 @@ "type": "array", "items": true } + }, + "annotations": { + "title": { "kind": "producer" }, + "description": { "kind": "producer" }, + "default": { "kind": "producer" }, + "deprecated": { "kind": "producer" }, + "readOnly": { "kind": "producer" }, + "writeOnly": { "kind": "producer" }, + "examples": { "kind": "producer" } } } diff --git a/meta/unevaluated.json b/meta/unevaluated.json index 58b411dd..4a5263a2 100644 --- a/meta/unevaluated.json +++ b/meta/unevaluated.json @@ -1,5 +1,5 @@ { - "$schema": "https://json-schema.org/draft/next/schema", + "$schema": "https://json-schema.org/draft/next/meta/vocabulary", "$id": "https://json-schema.org/draft/next/meta/unevaluated", "$vocabulary": { "https://json-schema.org/draft/next/vocab/unevaluated": true @@ -11,5 +11,17 @@ "properties": { "unevaluatedItems": { "$dynamicRef": "#meta" }, "unevaluatedProperties": { "$dynamicRef": "#meta" } + }, + "applicators": { + "unevaluatedItems": "arrayChild", + "unevaluatedProperties": "objectChild" + }, + "assertions": [ + "unevaluatedItems", + "unevaluatedProperties" + ], + "annotations": { + "unevaluatedItems": { "kind": "collector" }, + "unevaluatedProperties": { "kind": "collector" } } } diff --git a/meta/validation.json b/meta/validation.json index 69d52e95..e6d5ccff 100644 --- a/meta/validation.json +++ b/meta/validation.json @@ -1,5 +1,5 @@ { - "$schema": "https://json-schema.org/draft/next/schema", + "$schema": "https://json-schema.org/draft/next/meta/vocabulary", "$id": "https://json-schema.org/draft/next/meta/validation", "$vocabulary": { "https://json-schema.org/draft/next/vocab/validation": true @@ -68,6 +68,27 @@ } } }, + "assertions": [ + "type", + "const", + "multipleOf", + "maximum", + "exclusiveMaximum", + "minimum", + "exclusiveMinimum", + "maxLength", + "minLength", + "pattern", + "maxItems", + "minItems", + "uniqueItems", + "maxContains", + "minContains", + "maxProperties", + "minProperties", + "required", + "dependentRequired" + ], "$defs": { "nonNegativeInteger": { "type": "integer", diff --git a/meta/vocabulary.json b/meta/vocabulary.json new file mode 100644 index 00000000..c04a44c2 --- /dev/null +++ b/meta/vocabulary.json @@ -0,0 +1,72 @@ +{ + "$schema": "https://json-schema.org/draft/next/schema", + "$id": "https://json-schema.org/draft/next/meta/vocabulary", + "$vocabulary": { + "https://json-schema.org/draft/next/vocab/core": true, + "https://json-schema.org/draft/next/vocab/applicator": true, + "https://json-schema.org/draft/next/vocab/unevaluated": true, + "https://json-schema.org/draft/next/vocab/validation": true, + "https://json-schema.org/draft/next/vocab/meta-data": true, + "https://json-schema.org/draft/next/vocab/format-annotation": true, + "https://json-schema.org/draft/next/vocab/content": true, + "https://json-schema.org/draft/next/vocab/vocabulary": false + }, + + "title": "Vocabulary meta-data vocabulary meta-schema", + "description": "Defines keywords for use in vocabulary meta-schemas to provide additional information for their keywords", + "type": [ "object", "boolean" ], + "properties": { + "applicators": { + "type": "object", + "additionalProperties": { + "oneOf": [ + {"$ref": "#/$defs/applicatorKind"}, + { + "type": "array", + "items": { "$ref": "#/$defs/applicatorKind" }, + "minItems": 1, + "uniqueItems": true + } + ] + } + }, + "assertions": { + "type": "array", + "items": { "type": "string" } + }, + "annotations": { + "type": "object", + "properties": { + "kind": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { "$ref": "#/$defs/annotationKind" }, + { + "type": "array", + "items": { "$ref": "#/$defs/annotationKind" }, + "minItems": 1, + "uniqueItems": true + } + ] + } + }, + "producedValue": { "$dynamicRef": "#meta" } + }, + "required": [ "kind" ] + } + }, + "annotations": { + "applicators": { "kind": "producer" }, + "assertions": { "kind": "producer" }, + "annotations": { "kind": "producer" } + }, + "$defs": { + "applicatorKind": { + "enum": [ "objectChild", "arrayChild", "inPlace" ] + }, + "annotationKind": { + "enum": [ "producer", "collector" ] + } + } +} \ No newline at end of file