From 3d14d92f163dc845e82ce3e77977c82c20c1129b Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Fri, 22 Feb 2019 23:28:26 -0800 Subject: [PATCH 1/3] Identify vocabularies, update meta-schemas Includes verbiage on the likelihood of updated meta-schemas with later dates. The hyper-schema output format has not yet been updated to conform to the recent annotion/error output work. --- hyper-schema.json | 30 ++-- jsonschema-core.xml | 63 ++++--- jsonschema-hyperschema.xml | 35 +++- jsonschema-validation.xml | 78 ++++++-- links.json | 12 +- applicator.json => meta/applicator.json | 7 +- meta/content.json | 17 ++ core.json => meta/core.json | 6 +- meta/format.json | 14 ++ meta/hyper-schema.json | 29 +++ meta/meta-data.json | 33 ++++ meta/validation.json | 101 +++++++++++ .../hyper-schema.json | 6 +- schema-output.json => output/schema.json | 6 +- .../verbose-example.json | 0 schema.json | 169 +++--------------- 16 files changed, 380 insertions(+), 226 deletions(-) rename applicator.json => meta/applicator.json (87%) create mode 100644 meta/content.json rename core.json => meta/core.json (85%) create mode 100644 meta/format.json create mode 100644 meta/hyper-schema.json create mode 100644 meta/meta-data.json create mode 100644 meta/validation.json rename hyper-schema-output.json => output/hyper-schema.json (91%) rename schema-output.json => output/schema.json (94%) rename standardized-output-verbose.json => output/verbose-example.json (100%) diff --git a/hyper-schema.json b/hyper-schema.json index 5d72a263..96013fdd 100644 --- a/hyper-schema.json +++ b/hyper-schema.json @@ -1,22 +1,22 @@ { - "$schema": "http://json-schema.org/draft-08/hyper-schema#", - "$id": "http://json-schema.org/draft-08/hyper-schema", + "$schema": "http://json-schema.org/draft/2019-03/hyper-schema#", + "$id": "http://json-schema.org/draft/2019-03/hyper-schema", + "$vocabulary": { + "https://json-schema.org/draft/2019/03/vocab/core": true, + "https://json-schema.org/draft/2019/03/vocab/applicator": true, + "https://json-schema.org/draft/2019/03/vocab/validation": true, + "https://json-schema.org/draft/2019/03/vocab/meta-data": true, + "https://json-schema.org/draft/2019/03/vocab/format": true, + "https://json-schema.org/draft/2019/03/vocab/content": true, + "https://json-schema.org/draft/2019/03/vocab/hyper-schema": true + }, "$recursiveAnchor": true, "title": "JSON Hyper-Schema", - "$ref": "http://json-schema.org/draft-08/schema", - "properties": { - "base": { - "type": "string", - "format": "uri-template" - }, - "links": { - "type": "array", - "items": { - "$ref": "http://json-schema.org/draft-08/links" - } - } - }, + "allOf": [ + {"$ref": "http://json-schema.org/draft/2019-03/schema"}, + {"$ref": "http://json-schema.org/draft/2019-03/meta/hyper-schema"} + ], "links": [ { "rel": "self", diff --git a/jsonschema-core.xml b/jsonschema-core.xml index e4736366..9093bf35 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -1058,11 +1058,18 @@ The current URI for the Core vocabulary is: - . + . The current URI for the corresponding meta-schema is: - . + . + + + Updated vocabulary and meta-schema URIs MAY be published between + specification drafts in order to correct errors. Implementations + SHOULD consider URIs dated after this specification draft and + before the next to indicate the same syntax and semantics + as those listed here.
+ + Meta-schemas that do not use "$vocabulary" SHOULD be considered to + require this vocabulary as if its URI were present with a value of true. + The current URI for this vocabulary, known as the Applicator vocabulary, is: - . + . The current URI for the corresponding meta-schema is: - . + . - Meta-schemas that do not use "$vocabulary" SHOULD be considered to - require this vocabulary as if its URI were present with a value of true. + Updated vocabulary and meta-schema URIs MAY be published between + specification drafts in order to correct errors. Implementations + SHOULD consider URIs dated after this specification draft and + before the next to indicate the same syntax and semantics + as those listed here.
@@ -2479,7 +2493,7 @@
@@ -2555,7 +2569,7 @@ http://json-schema.org/draft-08/schema#/$defs/nonNegativeInteger/minimum Because this output structure can be quite large, a smaller example is given - here for brevity. The full output structure of the example above can be found - here. + here for brevity. The URI of the full output structure of the example above is: + .
@@ -2775,7 +2789,7 @@ http://json-schema.org/draft-08/schema#/$defs/nonNegativeInteger/minimum // schema { "$id": "http://example.com/polygon#", - "$schema": "http://json-schema.org/draft-08/schema#", + "$schema": "http://json-schema.org/draft/2019-03/schema#", "type": "object", "properties": { "validProp": true, @@ -2825,10 +2839,11 @@ http://json-schema.org/draft-08/schema#/$defs/nonNegativeInteger/minimum
-
+
- For convenience, a JSON Schema has been provided to validate output generated - by implementations. It can be found here. + For convenience, JSON Schema has been provided to validate output generated + by implementations. Its URI is: + .
diff --git a/jsonschema-hyperschema.xml b/jsonschema-hyperschema.xml index cfd90225..05fc523b 100644 --- a/jsonschema-hyperschema.xml +++ b/jsonschema-hyperschema.xml @@ -288,14 +288,24 @@
The current URI for the JSON Hyper-Schema meta-schema is - . + . + + + The current URI for this vocabulary, known as the Hyper-Schema vocabulary, is: + . + + + The current URI for the corresponding meta-schema, which differs from the + convenience meta-schema above in that it describes only the hyper-schema + keywords ("base" and "link") is: + . The link description format can be used without JSON Schema, and use of this format can be declared by referencing the normative link description schema as the schema for the data structure that uses the links. The URI of the normative link description schema is: - . + . JSON Hyper-Schema implementations are free to provide output in any format. @@ -306,7 +316,14 @@ It is RECOMMENDED that implementations be capable of producing output in this format to facilitated testing. The URI of the JSON Schema describing the recommended output format is - . + . + + + Updated vocabulary and meta-schema URIs MAY be published between + specification drafts in order to correct errors. Implementations + SHOULD consider URIs dated after this specification draft and + before the next to indicate the same syntax and semantics + as those listed here.
@@ -1607,7 +1624,7 @@ Link: ; rel="describedBy" ; rel="describedBy" ; rel="describedBy" ; rev="up" ; rev="up" ; rev="up" The current URI for the JSON Schema Validation meta-schema is - . - This meta-schema describes the core keywords, the subschema application - vocabulary from the core specification, and all keywords - defined by this specification. All implementations of this specification - SHOULD support the subschema application vocabulary, and MUST NOT - implement behavior that contradicts that vocabulary. + . + For schema author convenience, this meta-schema describes all vocabularies + defined in this specification and the JSON Schema Core specification. + Individual vocabulary and vocabulary meta-schema URIs are given for + each section below. + + + Updated vocabulary and meta-schema URIs MAY be published between + specification drafts in order to correct errors. Implementations + SHOULD consider URIs dated after this specification draft and + before the next to indicate the same syntax and semantics + as those listed here.
-
+
Validation keywords in a schema impose requirements for successful validation of an instance. These keywords are all assertions without any annotation behavior. + + Meta-schemas that do not use "$vocabulary" SHOULD be considered to + require this vocabulary as if its URI were present with a value of true. + + + The current URI for this vocabulary, known as the Validation vocabulary, is: + . + + + The current URI for the corresponding meta-schema is: + . +
@@ -496,7 +514,7 @@
-
+
@@ -514,6 +532,20 @@ format attribute and instance SHOULD succeed. + + Meta-schemas that do not use "$vocabulary" SHOULD be considered to + require this vocabulary as if its URI were present with a value of true, + although see the Implementation Requirements below for details. + + + The current URI for this vocabulary, known as the Format vocabulary, is: + . + + + The current URI for the corresponding meta-schema is: + . + +
@@ -733,7 +765,7 @@
-
+
@@ -745,6 +777,19 @@ These properties provide additional information required to interpret JSON data as rich multimedia documents. + + Meta-schemas that do not use "$vocabulary" SHOULD be considered to + require this vocabulary as if its URI were present with a value of true, + although see the Implementation Requirements below for details. + + + The current URI for this vocabulary, known as the Content vocabulary, is: + . + + + The current URI for the corresponding meta-schema is: + . +
@@ -914,13 +959,26 @@
-
+
These general-purpose annotation keywords provide commonly used information for documentation and user interface display purposes. They are not intended to form a comprehensive set of features. Rather, additional vocabularies can be defined for more complex annotation-based applications. + + Meta-schemas that do not use "$vocabulary" SHOULD be considered to + require this vocabulary as if its URI were present with a value of true. + + + The current URI for this vocabulary, known as the Meta-Data vocabulary, is: + . + + + The current URI for the corresponding meta-schema is: + . + +
The value of both of these keywords MUST be a string. diff --git a/links.json b/links.json index 435eecba..ddcca685 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", + "$schema": "http://json-schema.org/draft/2019-03/hyper-schema#", + "$id": "http://json-schema.org/draft/2019-03/links", "title": "Link Description Object", "allOf": [ { "required": [ "rel", "href" ] }, @@ -36,7 +36,7 @@ "format": "uri-template" }, "hrefSchema": { - "$recursiveRef": "http://json-schema.org/draft-08/hyper-schema", + "$recursiveRef": "http://json-schema.org/draft/2019-03/hyper-schema", "default": false }, "templatePointers": { @@ -63,7 +63,7 @@ "type": "string" }, "targetSchema": { - "$recursiveRef": "http://json-schema.org/draft-08/hyper-schema", + "$recursiveRef": "http://json-schema.org/draft/2019-03/hyper-schema", "default": true }, "targetMediaType": { @@ -71,7 +71,7 @@ }, "targetHints": { }, "headerSchema": { - "$recursiveRef": "http://json-schema.org/draft-08/hyper-schema", + "$recursiveRef": "http://json-schema.org/draft/2019-03/hyper-schema", "default": true }, "submissionMediaType": { @@ -79,7 +79,7 @@ "default": "application/json" }, "submissionSchema": { - "$recursiveRef": "http://json-schema.org/draft-08/hyper-schema", + "$recursiveRef": "http://json-schema.org/draft/2019-03/hyper-schema", "default": true }, "$comment": { diff --git a/applicator.json b/meta/applicator.json similarity index 87% rename from applicator.json rename to meta/applicator.json index de770dd2..88d2af0d 100644 --- a/applicator.json +++ b/meta/applicator.json @@ -1,10 +1,9 @@ { - "$schema": "http://json-schema.org/draft-08/schema#", - "$id": "https://json-schema.org/draft-08/applicator", + "$schema": "http://json-schema.org/draft/2019-03/schema#", + "$id": "https://json-schema.org/draft/2019-03/meta/applicator", "$recursiveAnchor": true, "$vocabulary": { - "https://json-schema.org/draft-08/vocabularies/core": true, - "https://json-schema.org/draft-08/vocabularies/applicator": true + "https://json-schema.org/draft/2019-03/vocab/applicator": true }, "title": "Applicator vocabulary meta-schema", diff --git a/meta/content.json b/meta/content.json new file mode 100644 index 00000000..a0f722be --- /dev/null +++ b/meta/content.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft/2019-03/schema#", + "$id": "http://json-schema.org/draft/2019-03/meta/content", + "$vocabulary": { + "https://json-schema.org/draft/2019-03/vocab/content": true + }, + "$recursiveAnchor": true, + + "title": "Content vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "contentSchema": { "$recursiveRef": "#" } + } +} diff --git a/core.json b/meta/core.json similarity index 85% rename from core.json rename to meta/core.json index d845b3dd..cdf52669 100644 --- a/core.json +++ b/meta/core.json @@ -1,9 +1,9 @@ { - "$schema": "http://json-schema.org/draft-08/schema#", - "$id": "https://json-schema.org/draft-08/core", + "$schema": "http://json-schema.org/draft/2019-03/schema#", + "$id": "https://json-schema.org/draft/2019-03/meta/core", "$recursiveAnchor": true, "$vocabulary": { - "https://json-schema.org/draft-08/vocabularies/core": true + "https://json-schema.org/draft/2019-03/vocab/core": true }, "title": "Core vocabulary meta-schema", diff --git a/meta/format.json b/meta/format.json new file mode 100644 index 00000000..bf4c8b55 --- /dev/null +++ b/meta/format.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft/2019-03/schema#", + "$id": "http://json-schema.org/draft/2019-03/meta/format", + "$vocabulary": { + "https://json-schema.org/draft/2019-03/vocab/format": true + }, + "$recursiveAnchor": true, + + "title": "Format vocabulary meta-schema", + "type": ["object", "boolean"], + "properties": { + "format": { "type": "string" } + } +} diff --git a/meta/hyper-schema.json b/meta/hyper-schema.json new file mode 100644 index 00000000..a9ccf874 --- /dev/null +++ b/meta/hyper-schema.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft/2019-03/hyper-schema#", + "$id": "http://json-schema.org/draft/2019-03/meta/hyper-schema", + "$vocabulary": { + "https://json-schema.org/draft/2019-03/vocab/hyper-schema": true + }, + "$recursiveAnchor": true, + + "title": "JSON Hyper-Schema Vocabulary Schema", + "type": ["object", "boolean"], + "properties": { + "base": { + "type": "string", + "format": "uri-template" + }, + "links": { + "type": "array", + "items": { + "$ref": "http://json-schema.org/draft/2019-03/links" + } + } + }, + "links": [ + { + "rel": "self", + "href": "{+%24id}" + } + ] +} diff --git a/meta/meta-data.json b/meta/meta-data.json new file mode 100644 index 00000000..0f3a493d --- /dev/null +++ b/meta/meta-data.json @@ -0,0 +1,33 @@ +{ + "$schema": "http://json-schema.org/draft/2019-03/schema#", + "$id": "http://json-schema.org/draft/2019-03/meta/meta-data", + "$vocabulary": { + "https://json-schema.org/draft/2019-03/vocab/meta-data": true + }, + "$recursiveAnchor": true, + + "title": "Meta-data vocabulary meta-schema", + + "type": ["object", "boolean"], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + } + } +} diff --git a/meta/validation.json b/meta/validation.json new file mode 100644 index 00000000..9098523a --- /dev/null +++ b/meta/validation.json @@ -0,0 +1,101 @@ +{ + "$schema": "http://json-schema.org/draft/2019-03/schema#", + "$id": "http://json-schema.org/draft/2019-03/meta/validation", + "$vocabulary": { + "https://json-schema.org/draft/2019-03/vocab/validation": true + }, + "$recursiveAnchor": true, + + "title": "Validation vocabulary meta-schema", + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/$defs/nonNegativeInteger" }, + "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { "$ref": "#/$defs/nonNegativeInteger" }, + "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$recursiveRef": "#" }, + "maxContains": { "$ref": "#/$defs/nonNegativeInteger" }, + "minContains": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 1 + }, + "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" }, + "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/$defs/stringArray" }, + "dependentRequired": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/stringArray" + } + }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/$defs/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/$defs/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + } + } +} diff --git a/hyper-schema-output.json b/output/hyper-schema.json similarity index 91% rename from hyper-schema-output.json rename to output/hyper-schema.json index 53593fa2..9a65132a 100644 --- a/hyper-schema-output.json +++ b/output/hyper-schema.json @@ -1,11 +1,11 @@ { - "$schema": "http://json-schema.org/draft-08/schema#", - "$id": "http://json-schema.org/draft-08/hyper-schema-output", + "$schema": "http://json-schema.org/draft/2019-03/schema#", + "$id": "http://json-schema.org/draft/2019-03/output/hyper-schema", "title": "JSON Hyper-Schema Output", "type": "array", "items": { "allOf": [ - {"$ref": "http://json-schema.org/draft-08/links#/$defs/noRequiredFields" } + {"$ref": "http://json-schema.org/draft/2019-03/links#/$defs/noRequiredFields" } ], "type": "object", "required": [ diff --git a/schema-output.json b/output/schema.json similarity index 94% rename from schema-output.json rename to output/schema.json index 579ef8bb..5d6fbb9f 100644 --- a/schema-output.json +++ b/output/schema.json @@ -1,6 +1,6 @@ { - "$schema": "http://json-schema.org/draft-08/schema#", - "$id": "http://json-schema.org/draft-08/schema-output#", + "$schema": "http://json-schema.org/draft/2019-03/schema#", + "$id": "http://json-schema.org/draft/2019-03/output/schema", "description": "A schema that validates the minimum requirements for validation output", "$defs": { "outputUnit":{ @@ -82,4 +82,4 @@ { "$ref": "#/$defs/detailed" }, { "$ref": "#/$defs/verbose" } ] -} \ No newline at end of file +} diff --git a/standardized-output-verbose.json b/output/verbose-example.json similarity index 100% rename from standardized-output-verbose.json rename to output/verbose-example.json diff --git a/schema.json b/schema.json index 281912c6..d30c02a0 100644 --- a/schema.json +++ b/schema.json @@ -1,42 +1,25 @@ { - "$schema": "http://json-schema.org/draft-08/schema#", - "$id": "http://json-schema.org/draft-08/schema#", + "$schema": "http://json-schema.org/draft/2019-03/schema#", + "$id": "http://json-schema.org/draft/2019-03/schema#", + "$vocabulary": { + "https://json-schema.org/draft/2019/03/vocab/core": true, + "https://json-schema.org/draft/2019/03/vocab/applicator": true, + "https://json-schema.org/draft/2019/03/vocab/validation": true, + "https://json-schema.org/draft/2019/03/vocab/meta-data": true, + "https://json-schema.org/draft/2019/03/vocab/format": true, + "https://json-schema.org/draft/2019/03/vocab/content": true + }, "$recursiveAnchor": true, - "$recursiveRef": "core", "title": "Core and Validation specifications meta-schema", - "$defs": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": { "$recursiveRef": "#" } - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 0 - }, - "simpleTypes": { - "enum": [ - "array", - "boolean", - "integer", - "null", - "number", - "object", - "string" - ] - }, - "stringArray": { - "type": "array", - "items": { "type": "string" }, - "uniqueItems": true, - "default": [] - } - }, + "allOf": [ + {"$ref": "meta/core"}, + {"$ref": "meta/applicator"}, + {"$ref": "meta/validation"}, + {"$ref": "meta/meta-data"}, + {"$ref": "meta/format"}, + {"$ref": "meta/content"} + ], "type": ["object", "boolean"], "properties": { "definitions": { @@ -45,127 +28,15 @@ "additionalProperties": { "$recursiveRef": "#" }, "default": {} }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": true, - "readOnly": { - "type": "boolean", - "default": false - }, - "examples": { - "type": "array", - "items": true - }, - "multipleOf": { - "type": "number", - "exclusiveMinimum": 0 - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "number" - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "number" - }, - "maxLength": { "$ref": "#/$defs/nonNegativeInteger" }, - "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": { "$recursiveRef": "#" }, - "items": { - "anyOf": [ - { "$recursiveRef": "#" }, - { "$ref": "#/$defs/schemaArray" } - ] - }, - "maxItems": { "$ref": "#/$defs/nonNegativeInteger" }, - "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "contains": { "$recursiveRef": "#" }, - "maxContains": { "$ref": "#/$defs/nonNegativeInteger" }, - "minContains": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 1 - }, - "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" }, - "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, - "required": { "$ref": "#/$defs/stringArray" }, - "additionalProperties": { "$recursiveRef": "#" }, - "properties": { - "type": "object", - "additionalProperties": { "$recursiveRef": "#" }, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": { "$recursiveRef": "#" }, - "propertyNames": { "format": "regex" }, - "default": {} - }, - "dependentSchemas": { - "type": "object", - "additionalProperties": { - "$recursiveRef": "#" - } - }, - "dependentRequired": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/stringArray" - } - }, "dependencies": { "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"", "type": "object", "additionalProperties": { "anyOf": [ { "$recursiveRef": "#" }, - { "$ref": "#/$defs/stringArray" } + { "$ref": "meta/validation#/$defs/stringArray" } ] } - }, - "propertyNames": { "$recursiveRef": "#" }, - "const": true, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - { "$ref": "#/$defs/simpleTypes" }, - { - "type": "array", - "items": { "$ref": "#/$defs/simpleTypes" }, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "format": { "type": "string" }, - "contentMediaType": { "type": "string" }, - "contentEncoding": { "type": "string" }, - "if": { "$recursiveRef": "#" }, - "then": { "$recursiveRef": "#" }, - "else": { "$recursiveRef": "#" }, - "allOf": { "$ref": "#/$defs/schemaArray" }, - "anyOf": { "$ref": "#/$defs/schemaArray" }, - "oneOf": { "$ref": "#/$defs/schemaArray" }, - "not": { "$recursiveRef": "#" } + } } } From 5e4cca4f00de4fd65ce14502365194bcbc09e9f7 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Tue, 26 Feb 2019 17:51:10 -0800 Subject: [PATCH 2/3] Put meta-schema keywords in standard order This is mostly about the self-describing keywords near the top, but also settled on moving "$defs" to the end to avoid obscuring the high-level structure of the schema. --- meta/applicator.json | 16 ++++++------- meta/core.json | 2 +- meta/validation.json | 54 ++++++++++++++++++++++---------------------- output/schema.json | 15 ++++++------ 4 files changed, 44 insertions(+), 43 deletions(-) diff --git a/meta/applicator.json b/meta/applicator.json index 88d2af0d..9e5ed560 100644 --- a/meta/applicator.json +++ b/meta/applicator.json @@ -1,19 +1,12 @@ { "$schema": "http://json-schema.org/draft/2019-03/schema#", "$id": "https://json-schema.org/draft/2019-03/meta/applicator", - "$recursiveAnchor": true, "$vocabulary": { "https://json-schema.org/draft/2019-03/vocab/applicator": true }, + "$recursiveAnchor": true, "title": "Applicator vocabulary meta-schema", - "$defs": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": { "$recursiveRef": "#" } - } - }, "properties": { "additionalItems": { "$recursiveRef": "#" }, "unevaluatedItems": { "$recursiveRef": "#" }, @@ -56,5 +49,12 @@ "anyOf": { "$ref": "#/$defs/schemaArray" }, "oneOf": { "$ref": "#/$defs/schemaArray" }, "not": { "$recursiveRef": "#" } + }, + "$defs": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$recursiveRef": "#" } + } } } diff --git a/meta/core.json b/meta/core.json index cdf52669..0e7363f7 100644 --- a/meta/core.json +++ b/meta/core.json @@ -1,10 +1,10 @@ { "$schema": "http://json-schema.org/draft/2019-03/schema#", "$id": "https://json-schema.org/draft/2019-03/meta/core", - "$recursiveAnchor": true, "$vocabulary": { "https://json-schema.org/draft/2019-03/vocab/core": true }, + "$recursiveAnchor": true, "title": "Core vocabulary meta-schema", "type": ["object", "boolean"], diff --git a/meta/validation.json b/meta/validation.json index 9098523a..cf5d49e8 100644 --- a/meta/validation.json +++ b/meta/validation.json @@ -7,33 +7,6 @@ "$recursiveAnchor": true, "title": "Validation vocabulary meta-schema", - "$defs": { - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "$ref": "#/$defs/nonNegativeInteger", - "default": 0 - }, - "simpleTypes": { - "enum": [ - "array", - "boolean", - "integer", - "null", - "number", - "object", - "string" - ] - }, - "stringArray": { - "type": "array", - "items": { "type": "string" }, - "uniqueItems": true, - "default": [] - } - }, "type": ["object", "boolean"], "properties": { "multipleOf": { @@ -97,5 +70,32 @@ } ] } + }, + "$defs": { + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "$ref": "#/$defs/nonNegativeInteger", + "default": 0 + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } } } diff --git a/output/schema.json b/output/schema.json index 5d6fbb9f..cfd692b8 100644 --- a/output/schema.json +++ b/output/schema.json @@ -2,6 +2,13 @@ "$schema": "http://json-schema.org/draft/2019-03/schema#", "$id": "http://json-schema.org/draft/2019-03/output/schema", "description": "A schema that validates the minimum requirements for validation output", + + "oneOf": [ + { "$ref": "#/$defs/flag" }, + { "$ref": "#/$defs/basic" }, + { "$ref": "#/$defs/detailed" }, + { "$ref": "#/$defs/verbose" } + ], "$defs": { "outputUnit":{ "properties": { @@ -75,11 +82,5 @@ "basic": { "$ref": "#/outputUnit" }, "detailed": { "$ref": "#/outputUnit" }, "verbose": { "$ref": "#/outputUnit" } - }, - "oneOf": [ - { "$ref": "#/$defs/flag" }, - { "$ref": "#/$defs/basic" }, - { "$ref": "#/$defs/detailed" }, - { "$ref": "#/$defs/verbose" } - ] + } } From 4faa3c72af0fa4e741ffdd4fd0122cd5af50bcdc Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Sun, 17 Mar 2019 20:33:36 -0700 Subject: [PATCH 3/3] Fix and update mets/vocab dates Should always be hyphen. Also, admit that this is not going to be done this month either :-/ --- hyper-schema.json | 22 +++++++++++----------- jsonschema-core.xml | 38 +++++++++++++++++++------------------- jsonschema-hyperschema.xml | 22 +++++++++++----------- jsonschema-validation.xml | 18 +++++++++--------- links.json | 12 ++++++------ meta/applicator.json | 6 +++--- meta/content.json | 6 +++--- meta/core.json | 6 +++--- meta/format.json | 6 +++--- meta/hyper-schema.json | 8 ++++---- meta/meta-data.json | 6 +++--- meta/validation.json | 6 +++--- output/hyper-schema.json | 6 +++--- output/schema.json | 4 ++-- schema.json | 16 ++++++++-------- 15 files changed, 91 insertions(+), 91 deletions(-) diff --git a/hyper-schema.json b/hyper-schema.json index 96013fdd..07d331dd 100644 --- a/hyper-schema.json +++ b/hyper-schema.json @@ -1,21 +1,21 @@ { - "$schema": "http://json-schema.org/draft/2019-03/hyper-schema#", - "$id": "http://json-schema.org/draft/2019-03/hyper-schema", + "$schema": "http://json-schema.org/draft/2019-04/hyper-schema#", + "$id": "http://json-schema.org/draft/2019-04/hyper-schema", "$vocabulary": { - "https://json-schema.org/draft/2019/03/vocab/core": true, - "https://json-schema.org/draft/2019/03/vocab/applicator": true, - "https://json-schema.org/draft/2019/03/vocab/validation": true, - "https://json-schema.org/draft/2019/03/vocab/meta-data": true, - "https://json-schema.org/draft/2019/03/vocab/format": true, - "https://json-schema.org/draft/2019/03/vocab/content": true, - "https://json-schema.org/draft/2019/03/vocab/hyper-schema": true + "https://json-schema.org/draft/2019-04/vocab/core": true, + "https://json-schema.org/draft/2019-04/vocab/applicator": true, + "https://json-schema.org/draft/2019-04/vocab/validation": true, + "https://json-schema.org/draft/2019-04/vocab/meta-data": true, + "https://json-schema.org/draft/2019-04/vocab/format": true, + "https://json-schema.org/draft/2019-04/vocab/content": true, + "https://json-schema.org/draft/2019-04/vocab/hyper-schema": true }, "$recursiveAnchor": true, "title": "JSON Hyper-Schema", "allOf": [ - {"$ref": "http://json-schema.org/draft/2019-03/schema"}, - {"$ref": "http://json-schema.org/draft/2019-03/meta/hyper-schema"} + {"$ref": "http://json-schema.org/draft/2019-04/schema"}, + {"$ref": "http://json-schema.org/draft/2019-04/meta/hyper-schema"} ], "links": [ { diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 9093bf35..8f5d6365 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -1058,11 +1058,11 @@ The current URI for the Core vocabulary is: - . + . The current URI for the corresponding meta-schema is: - . + . Updated vocabulary and meta-schema URIs MAY be published between @@ -1088,16 +1088,16 @@ The current URI for this vocabulary, known as the Applicator vocabulary, is: - . + . The current URI for the corresponding meta-schema is: - . + . Updated vocabulary and meta-schema URIs MAY be published between @@ -2493,7 +2493,7 @@
@@ -2569,7 +2569,7 @@ http://json-schema.org/draft/2019-03/schema#/$defs/nonNegativeInteger/minimum Because this output structure can be quite large, a smaller example is given here for brevity. The URI of the full output structure of the example above is: - . + .
@@ -2789,7 +2789,7 @@ http://json-schema.org/draft/2019-03/schema#/$defs/nonNegativeInteger/minimum // schema { "$id": "http://example.com/polygon#", - "$schema": "http://json-schema.org/draft/2019-03/schema#", + "$schema": "http://json-schema.org/draft/2019-04/schema#", "type": "object", "properties": { "validProp": true, @@ -2843,7 +2843,7 @@ http://json-schema.org/draft/2019-03/schema#/$defs/nonNegativeInteger/minimum For convenience, JSON Schema has been provided to validate output generated by implementations. Its URI is: - . + .
diff --git a/jsonschema-hyperschema.xml b/jsonschema-hyperschema.xml index 05fc523b..e77f077d 100644 --- a/jsonschema-hyperschema.xml +++ b/jsonschema-hyperschema.xml @@ -288,24 +288,24 @@
The current URI for the JSON Hyper-Schema meta-schema is - . + . The current URI for this vocabulary, known as the Hyper-Schema vocabulary, is: - . + . The current URI for the corresponding meta-schema, which differs from the convenience meta-schema above in that it describes only the hyper-schema keywords ("base" and "link") is: - . + . The link description format can be used without JSON Schema, and use of this format can be declared by referencing the normative link description schema as the schema for the data structure that uses the links. The URI of the normative link description schema is: - . + . JSON Hyper-Schema implementations are free to provide output in any format. @@ -316,7 +316,7 @@ It is RECOMMENDED that implementations be capable of producing output in this format to facilitated testing. The URI of the JSON Schema describing the recommended output format is - . + . Updated vocabulary and meta-schema URIs MAY be published between @@ -1624,7 +1624,7 @@ Link: ; rel="describedBy" ; rel="describedBy" ; rel="describedBy" ; rev="up" ; rev="up" ; rev="up" The current URI for the JSON Schema Validation meta-schema is - . + . For schema author convenience, this meta-schema describes all vocabularies defined in this specification and the JSON Schema Core specification. Individual vocabulary and vocabulary meta-schema URIs are given for @@ -218,11 +218,11 @@ The current URI for this vocabulary, known as the Validation vocabulary, is: - . + . The current URI for the corresponding meta-schema is: - . + .
@@ -539,11 +539,11 @@ The current URI for this vocabulary, known as the Format vocabulary, is: - . + . The current URI for the corresponding meta-schema is: - . + .
@@ -784,11 +784,11 @@
The current URI for this vocabulary, known as the Content vocabulary, is: - . + . The current URI for the corresponding meta-schema is: - . + .
@@ -972,11 +972,11 @@ The current URI for this vocabulary, known as the Meta-Data vocabulary, is: - . + . The current URI for the corresponding meta-schema is: - . + .
diff --git a/links.json b/links.json index ddcca685..a5d5469c 100644 --- a/links.json +++ b/links.json @@ -1,6 +1,6 @@ { - "$schema": "http://json-schema.org/draft/2019-03/hyper-schema#", - "$id": "http://json-schema.org/draft/2019-03/links", + "$schema": "http://json-schema.org/draft/2019-04/hyper-schema#", + "$id": "http://json-schema.org/draft/2019-04/links", "title": "Link Description Object", "allOf": [ { "required": [ "rel", "href" ] }, @@ -36,7 +36,7 @@ "format": "uri-template" }, "hrefSchema": { - "$recursiveRef": "http://json-schema.org/draft/2019-03/hyper-schema", + "$recursiveRef": "http://json-schema.org/draft/2019-04/hyper-schema", "default": false }, "templatePointers": { @@ -63,7 +63,7 @@ "type": "string" }, "targetSchema": { - "$recursiveRef": "http://json-schema.org/draft/2019-03/hyper-schema", + "$recursiveRef": "http://json-schema.org/draft/2019-04/hyper-schema", "default": true }, "targetMediaType": { @@ -71,7 +71,7 @@ }, "targetHints": { }, "headerSchema": { - "$recursiveRef": "http://json-schema.org/draft/2019-03/hyper-schema", + "$recursiveRef": "http://json-schema.org/draft/2019-04/hyper-schema", "default": true }, "submissionMediaType": { @@ -79,7 +79,7 @@ "default": "application/json" }, "submissionSchema": { - "$recursiveRef": "http://json-schema.org/draft/2019-03/hyper-schema", + "$recursiveRef": "http://json-schema.org/draft/2019-04/hyper-schema", "default": true }, "$comment": { diff --git a/meta/applicator.json b/meta/applicator.json index 9e5ed560..43b104ef 100644 --- a/meta/applicator.json +++ b/meta/applicator.json @@ -1,8 +1,8 @@ { - "$schema": "http://json-schema.org/draft/2019-03/schema#", - "$id": "https://json-schema.org/draft/2019-03/meta/applicator", + "$schema": "http://json-schema.org/draft/2019-04/schema#", + "$id": "https://json-schema.org/draft/2019-04/meta/applicator", "$vocabulary": { - "https://json-schema.org/draft/2019-03/vocab/applicator": true + "https://json-schema.org/draft/2019-04/vocab/applicator": true }, "$recursiveAnchor": true, diff --git a/meta/content.json b/meta/content.json index a0f722be..2262099a 100644 --- a/meta/content.json +++ b/meta/content.json @@ -1,8 +1,8 @@ { - "$schema": "http://json-schema.org/draft/2019-03/schema#", - "$id": "http://json-schema.org/draft/2019-03/meta/content", + "$schema": "http://json-schema.org/draft/2019-04/schema#", + "$id": "http://json-schema.org/draft/2019-04/meta/content", "$vocabulary": { - "https://json-schema.org/draft/2019-03/vocab/content": true + "https://json-schema.org/draft/2019-04/vocab/content": true }, "$recursiveAnchor": true, diff --git a/meta/core.json b/meta/core.json index 0e7363f7..6ba4329e 100644 --- a/meta/core.json +++ b/meta/core.json @@ -1,8 +1,8 @@ { - "$schema": "http://json-schema.org/draft/2019-03/schema#", - "$id": "https://json-schema.org/draft/2019-03/meta/core", + "$schema": "http://json-schema.org/draft/2019-04/schema#", + "$id": "https://json-schema.org/draft/2019-04/meta/core", "$vocabulary": { - "https://json-schema.org/draft/2019-03/vocab/core": true + "https://json-schema.org/draft/2019-04/vocab/core": true }, "$recursiveAnchor": true, diff --git a/meta/format.json b/meta/format.json index bf4c8b55..02970f37 100644 --- a/meta/format.json +++ b/meta/format.json @@ -1,8 +1,8 @@ { - "$schema": "http://json-schema.org/draft/2019-03/schema#", - "$id": "http://json-schema.org/draft/2019-03/meta/format", + "$schema": "http://json-schema.org/draft/2019-04/schema#", + "$id": "http://json-schema.org/draft/2019-04/meta/format", "$vocabulary": { - "https://json-schema.org/draft/2019-03/vocab/format": true + "https://json-schema.org/draft/2019-04/vocab/format": true }, "$recursiveAnchor": true, diff --git a/meta/hyper-schema.json b/meta/hyper-schema.json index a9ccf874..8f427d4b 100644 --- a/meta/hyper-schema.json +++ b/meta/hyper-schema.json @@ -1,8 +1,8 @@ { - "$schema": "http://json-schema.org/draft/2019-03/hyper-schema#", - "$id": "http://json-schema.org/draft/2019-03/meta/hyper-schema", + "$schema": "http://json-schema.org/draft/2019-04/hyper-schema#", + "$id": "http://json-schema.org/draft/2019-04/meta/hyper-schema", "$vocabulary": { - "https://json-schema.org/draft/2019-03/vocab/hyper-schema": true + "https://json-schema.org/draft/2019-04/vocab/hyper-schema": true }, "$recursiveAnchor": true, @@ -16,7 +16,7 @@ "links": { "type": "array", "items": { - "$ref": "http://json-schema.org/draft/2019-03/links" + "$ref": "http://json-schema.org/draft/2019-04/links" } } }, diff --git a/meta/meta-data.json b/meta/meta-data.json index 0f3a493d..a5eee1c2 100644 --- a/meta/meta-data.json +++ b/meta/meta-data.json @@ -1,8 +1,8 @@ { - "$schema": "http://json-schema.org/draft/2019-03/schema#", - "$id": "http://json-schema.org/draft/2019-03/meta/meta-data", + "$schema": "http://json-schema.org/draft/2019-04/schema#", + "$id": "http://json-schema.org/draft/2019-04/meta/meta-data", "$vocabulary": { - "https://json-schema.org/draft/2019-03/vocab/meta-data": true + "https://json-schema.org/draft/2019-04/vocab/meta-data": true }, "$recursiveAnchor": true, diff --git a/meta/validation.json b/meta/validation.json index cf5d49e8..4665fe57 100644 --- a/meta/validation.json +++ b/meta/validation.json @@ -1,8 +1,8 @@ { - "$schema": "http://json-schema.org/draft/2019-03/schema#", - "$id": "http://json-schema.org/draft/2019-03/meta/validation", + "$schema": "http://json-schema.org/draft/2019-04/schema#", + "$id": "http://json-schema.org/draft/2019-04/meta/validation", "$vocabulary": { - "https://json-schema.org/draft/2019-03/vocab/validation": true + "https://json-schema.org/draft/2019-04/vocab/validation": true }, "$recursiveAnchor": true, diff --git a/output/hyper-schema.json b/output/hyper-schema.json index 9a65132a..04e6e05a 100644 --- a/output/hyper-schema.json +++ b/output/hyper-schema.json @@ -1,11 +1,11 @@ { - "$schema": "http://json-schema.org/draft/2019-03/schema#", - "$id": "http://json-schema.org/draft/2019-03/output/hyper-schema", + "$schema": "http://json-schema.org/draft/2019-04/schema#", + "$id": "http://json-schema.org/draft/2019-04/output/hyper-schema", "title": "JSON Hyper-Schema Output", "type": "array", "items": { "allOf": [ - {"$ref": "http://json-schema.org/draft/2019-03/links#/$defs/noRequiredFields" } + {"$ref": "http://json-schema.org/draft/2019-04/links#/$defs/noRequiredFields" } ], "type": "object", "required": [ diff --git a/output/schema.json b/output/schema.json index cfd692b8..d9ab2cd1 100644 --- a/output/schema.json +++ b/output/schema.json @@ -1,6 +1,6 @@ { - "$schema": "http://json-schema.org/draft/2019-03/schema#", - "$id": "http://json-schema.org/draft/2019-03/output/schema", + "$schema": "http://json-schema.org/draft/2019-04/schema#", + "$id": "http://json-schema.org/draft/2019-04/output/schema", "description": "A schema that validates the minimum requirements for validation output", "oneOf": [ diff --git a/schema.json b/schema.json index d30c02a0..74215b30 100644 --- a/schema.json +++ b/schema.json @@ -1,13 +1,13 @@ { - "$schema": "http://json-schema.org/draft/2019-03/schema#", - "$id": "http://json-schema.org/draft/2019-03/schema#", + "$schema": "http://json-schema.org/draft/2019-04/schema#", + "$id": "http://json-schema.org/draft/2019-04/schema#", "$vocabulary": { - "https://json-schema.org/draft/2019/03/vocab/core": true, - "https://json-schema.org/draft/2019/03/vocab/applicator": true, - "https://json-schema.org/draft/2019/03/vocab/validation": true, - "https://json-schema.org/draft/2019/03/vocab/meta-data": true, - "https://json-schema.org/draft/2019/03/vocab/format": true, - "https://json-schema.org/draft/2019/03/vocab/content": true + "https://json-schema.org/draft/2019-04/vocab/core": true, + "https://json-schema.org/draft/2019-04/vocab/applicator": true, + "https://json-schema.org/draft/2019-04/vocab/validation": true, + "https://json-schema.org/draft/2019-04/vocab/meta-data": true, + "https://json-schema.org/draft/2019-04/vocab/format": true, + "https://json-schema.org/draft/2019-04/vocab/content": true }, "$recursiveAnchor": true,