From 91fea475260db56b7ec6dfc08d2b7867c4114658 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Tue, 20 Apr 2021 11:08:30 -0700 Subject: [PATCH 01/13] Move contains to "other" applicator section --- jsonschema-core.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index f580d50c..7e810925 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2502,7 +2502,6 @@
-
The value of this keyword MUST be a valid JSON Schema. From a469d9b06d2d385235d2f1d3cc882babd3496e95 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Mon, 27 Jun 2022 14:06:18 +1200 Subject: [PATCH 02/13] updated output structure description, example schema and instances, and explanation of results --- jsonschema-core.xml | 204 +++++++++++++++++++++++++++++++------------- 1 file changed, 146 insertions(+), 58 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 7e810925..b6c61108 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2756,9 +2756,9 @@ Implementations MAY elect to provide additional information. -
+
- The relative location of the validating keyword that follows the path + The relative location of the validating subschema that follows the path traversed through the schema. The value MUST be expressed as a JSON Pointer, and it MUST include any by-reference applicators such as "$ref" or "$dynamicRef". @@ -2776,22 +2776,20 @@ - Note that this pointer may not be resolvable by the normal JSON Pointer process - due to the inclusion of these by-reference applicator keywords. + Note that this pointer may not be resolvable by the normal JSON Pointer process + due to the inclusion of these by-reference applicator keywords. The JSON key for this information is "evaluationPath".
-
+
- The absolute, dereferenced location of the validating keyword. The value MUST - be expressed as a full IRI using the canonical IRI of the relevant schema resource - with a JSON Pointer fragment, and it MUST NOT include by-reference applicators - such as "$ref" or "$dynamicRef" as non-terminal path components. - It MAY end in such keywords if the error or annotation is for that - keyword, such as an unresolvable reference. + The absolute, dereferenced location of the validating subschema. The value MUST + be expressed as a full IRI using the canonical IRI of the relevant + schema object, and it MUST NOT include by-reference applicators + such as "$ref" or "$dynamicRef" as path components. Note that "absolute" here is in the sense of "absolute filesystem path" (meaning the complete location) rather than the "absolute-IRI" @@ -2807,10 +2805,6 @@ https://example.com/schemas/common#/$defs/count/minimum ]]> - - This information MAY be omitted only if either the dynamic scope did not pass - over a reference or if the schema does not declare an absolute IRI as its "$id". - The JSON key for this information is "schemaLocation". @@ -2826,32 +2820,48 @@ https://example.com/schemas/common#/$defs/count/minimum
-
+
- The error or annotation that is produced by the validation. + Any errors produced by the validation. This property MUST NOT + be included if the validation was successful. The value + for this property is an object where the keys are the names of + keywords and the values are the error message produced by the + associated keyword. - For errors, the specific wording for the message is not defined by this + The specific wording for the message is not defined by this specification. Implementations will need to provide this. - For annotations, each keyword that produces an annotation specifies its - format. By default, it is the keyword's value. + The JSON key for this information is "errors". + +
+ +
+ + Any annotations produced by the validation. This property MUST NOT + be included if the validation was unsuccessful. The value + for this property is an object where the keys are the names of + keywords and the values are the annotations produced by the + associated keyword. + + + Each keyword defines its own annotation data type (e.g. "properties" + produces a list of keywords, whereas "$title" produces a string). - The JSON key for failed validations is "error"; for successful validations - it is "annotation". + The JSON key for this information is "annotations".
For "basic", this property will appear only at the root node and will hold - all errors or annotations in a list. + all results in a flat list. - For "detailed" and "verbose", this property will hold nested errors - and annotations in a tree structure, mimicking that of the schema. + For "detailed" and "verbose", this property will hold nested results + in a tree structure, mimicking that of the schema. The JSON key for nested results is "nested". @@ -2871,67 +2881,145 @@ https://example.com/schemas/common#/$defs/count/minimum failure - "nested" - the collection of errors or annotations produced by a keyword + "nested" - the collection of errors or annotations produced by a subschema - For these examples, the following schema and instance will be used. + For these examples, the following schema and instances will be used.
- This instance will fail validation and produce errors, but it's trivial to deduce - examples for passing schemas that produce annotations. + The failing instance will produce the following errors: + + + The value at "/foo/foo-prop" + validated at "/properties/foo/properties/foo-prop" + by following the path "/properties/foo/properties/foo-prop" + by the "const" keyword + is not the constant value 1. + + + The value at "/bar/bar-prop" + validated at "/$defs/bar/properties/bar-prop" + by following the path "/properties/bar/$ref/properties/bar-prop" + by the "type" keyword + is not a number. + + + + "minimum" doesn't produce an error because it only operates on + instances that are numbers. + + + Note that the error message wording as depicted in the examples below is not a + requirement of this specification. Implementations SHOULD craft error messages + tailored for their audience or provide a templating mechanism that allows their + users to craft their own messages. + - Specifically, the errors it will produce are: + The passing instance will produce the following annotations: - The second object is missing a "y" property. + The keyword "title" + validated at "" + by following the path "" + will produce "root". + + + The keyword "properties" + validated at "" + by following the path "" + will produce "["foo", "bar"]". + + + The keyword "title" + validated at "/properties/foo" + by following the path "/properties/foo" + will produce "foo-title". + + + The keyword "properties" + validated at "/properties/foo" + by following the path "/properties/foo" + will produce "["foo-prop"]". + + + The keyword "title" + validated at "/properties/foo/properties/foo-prop" + by following the path "/properties/foo/properties/foo-prop" + will produce "foo-prop-title". + + + The keyword "title" + validated at "/$defs/bar" + by following the path "/properties/bar/$ref" + will produce "bar-title". - The second object has a disallowed "z" property. + The keyword "properties" + validated at "/$defs/bar" + by following the path "/properties/var/$ref" + will produce "["bar-prop"]". - There are only two objects, but three are required. + The keyword "title" + validated at "/$defs/bar/properties/bar-prop" + by following the path "/properties/bar/$ref/properties/bar-prop" + will produce "bar-prop-title". - Note that the error message wording as depicted in these examples is not a - requirement of this specification. Implementations SHOULD craft error messages - tailored for their audience or provide a templating mechanism that allows their - users to craft their own messages.
From 8a73d7b90a87fc020d4e9fe9afa2e664e2800301 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 28 Jun 2022 00:23:37 +1200 Subject: [PATCH 03/13] update wording for structures and associated examples --- jsonschema-core.xml | 337 +++++++++++++++++++++--------------- output/verbose-example.json | 130 -------------- 2 files changed, 198 insertions(+), 269 deletions(-) delete mode 100644 output/verbose-example.json diff --git a/jsonschema-core.xml b/jsonschema-core.xml index b6c61108..c413d439 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2826,7 +2826,8 @@ https://example.com/schemas/common#/$defs/count/minimum be included if the validation was successful. The value for this property is an object where the keys are the names of keywords and the values are the error message produced by the - associated keyword. + associated keyword. If the subschema itself is producing the + error, that error MUST be listed with an empty string key. The specific wording for the message is not defined by this @@ -2856,13 +2857,17 @@ https://example.com/schemas/common#/$defs/count/minimum
- For "basic", this property will appear only at the root node and will hold - all results in a flat list. + For "basic", this property will appear only at the root output unit + and will hold all results in a flat list. For "detailed" and "verbose", this property will hold nested results in a tree structure, mimicking that of the schema. + + The sequence of output units within this list is not specified and + may be determined by the implementation. + The JSON key for nested results is "nested". @@ -2897,14 +2902,20 @@ https://example.com/schemas/common#/$defs/count/minimum "title": "root", "properties": { "foo": { - "type": "object", - "title": "foo-title", - "properties": { - "foo-prop": { - "const": 1, - "title": "foo-prop-title" + "allOf": [ + { "required": [ "unspecified-prop" ] }, + { + "type": "object", + "title": "foo-title", + "properties": { + "foo-prop": { + "const": 1, + "title": "foo-prop-title" + } + }, + "additionalProperties": { "type": "boolean" } } - } + ] }, "bar": { "$ref": "#/$defs/bar" @@ -2927,13 +2938,16 @@ https://example.com/schemas/common#/$defs/count/minimum // failing instance { - "foo": {"foo-prop": "not 1"}, + "foo": {"foo-prop": "not 1", "other-prop": false}, "bar": {"bar-prop": 2} } // passing instance { - "foo": {"foo-prop": 1}, + "foo": { + "foo-prop": 1, + "unspecified-prop": true + }, "bar": {"bar-prop": 20} } ]]> @@ -2942,10 +2956,17 @@ https://example.com/schemas/common#/$defs/count/minimum The failing instance will produce the following errors: + + The value at "/foo" + validated at "/properties/foo/allOf/0" + by following the path "/properties/foo/allOf/0" + by the "required" keyword + is missing the property "unspecified-prop". + The value at "/foo/foo-prop" - validated at "/properties/foo/properties/foo-prop" - by following the path "/properties/foo/properties/foo-prop" + validated at "/properties/foo/allOf/1/properties/foo-prop" + by following the path "/properties/foo/allOf/1/properties/foo-prop" by the "const" keyword is not the constant value 1. @@ -2975,49 +2996,55 @@ https://example.com/schemas/common#/$defs/count/minimum The keyword "title" validated at "" by following the path "" - will produce "root". + will produce "root". The keyword "properties" validated at "" by following the path "" - will produce "["foo", "bar"]". + will produce ["foo", "bar"]. The keyword "title" validated at "/properties/foo" by following the path "/properties/foo" - will produce "foo-title". + will produce "foo-title". The keyword "properties" - validated at "/properties/foo" - by following the path "/properties/foo" - will produce "["foo-prop"]". + validated at "/properties/foo/allOf/1" + by following the path "/properties/foo/allOf/1" + will produce ["foo-prop"]. The keyword "title" - validated at "/properties/foo/properties/foo-prop" - by following the path "/properties/foo/properties/foo-prop" - will produce "foo-prop-title". + validated at "/properties/foo/allOf/1/properties/foo-prop" + by following the path "/properties/foo/allOf/1/properties/foo-prop" + will produce "foo-prop-title". + + + The keyword "additionalProperties" + validated at "/properties/foo/allOf/1" + by following the path "/properties/foo/allOf/1" + will produce ["unspecified-prop"]. The keyword "title" validated at "/$defs/bar" by following the path "/properties/bar/$ref" - will produce "bar-title". + will produce "bar-title". The keyword "properties" validated at "/$defs/bar" by following the path "/properties/var/$ref" - will produce "["bar-prop"]". + will produce ["bar-prop"]. The keyword "title" validated at "/$defs/bar/properties/bar-prop" by following the path "/properties/bar/$ref/properties/bar-prop" - will produce "bar-prop-title". + will produce "bar-prop-title". @@ -3025,7 +3052,8 @@ https://example.com/schemas/common#/$defs/count/minimum
In the simplest case, merely the boolean result for the "valid" valid property - needs to be fulfilled. + needs to be fulfilled. For this format, all other information is explicitly + omitted.
@@ -3040,7 +3068,7 @@ https://example.com/schemas/common#/$defs/count/minimum Because no errors or annotations are returned with this format, it is RECOMMENDED that implementations use short-circuiting logic to return failure or success as soon as the outcome can be determined. For example, - if an "anyOf" keyword contains five sub-schemas, and the second one + if an "anyOf" keyword contains five subschemas, and the second one passes, there is no need to check the other three. The logic can simply return with success. @@ -3048,44 +3076,52 @@ https://example.com/schemas/common#/$defs/count/minimum
- The "Basic" structure is a flat list of output units. + The "Basic" structure is a flat list of output units contained within a + root output unit. + + + The root output unit contains "valid" for the overall result and "nested" + for the list of specific results. All other information is explicitly + omitted from the root output unit. + + + Intermediate output units, which do not themselves produce errors but + represent subschemas that contain error-producing subschemas, MAY be + included.
- The "Detailed" structure is based on the schema and can be more readable - for both humans and machines. Having the structure organized this way makes - associations between the errors more apparent. For example, the fact that - the missing "y" property and the extra "z" property both stem from the same - location in the instance is not immediately obvious in the "Basic" structure. - In a hierarchy, the correlation is more easily identified. + The "Detailed" format is a hierarchical structure based on that of the schema + and can be more readable for both humans and machines by grouping together + output units that apply to the same subschemas. + + + The root output unit contains "valid" for the overall result and "nested" + for the list of specific results. All other information is explicitly + omitted from the root output unit. The following rules govern the construction of the results object: All applicator keywords ("*Of", "$ref", "if"/"then"/"else", etc.) require - a node. + a output unit. - Nodes that have no children are removed. + Output units that have no children are removed. - Nodes that have a single child are replaced by the child. + Output units that have a single child are replaced by the child. - Branch nodes do not require an error message or an annotation. + Branch output units do not require an error message or an annotation.
The primary difference between this and the "Detailed" structure is that - all results are returned. This includes sub-schema validation results that - would otherwise be removed (e.g. annotations for failed validations, - successful validations inside a `not` keyword, etc.). Because of this, it - is RECOMMENDED that each node also carry a `valid` property to indicate the - validation result for that node. - - - Because this output structure can be quite large, a smaller example is given - here for brevity. The IRI of the full output structure of the example above is: - . + all results are returned. This includes subschema validation results that + would otherwise be removed (e.g. passing subschemas contained within failing + subschemas, etc.). Because of this, each output unit MUST also carry a + "valid" property to indicate its local validation result.
+ "valid": false, + "nested": [ + { + "valid": false, + "evaluationPath": "/properties/foo", + "schemaLocation": + "https://json-schema.org/schemas/example#/properties/foo", + "instanceLocation": "/foo", + "nested": [ + { + "valid": false, + "evaluationPath": "/properties/foo/allOf/0", + "schemaLocation": + "https://json-schema.org/schemas/example#/properties/foo/allOf/0", + "instanceLocation": "/foo", + "errors": { + "required": "Expected the property \"unspecified-prop\"." + } + }, + { + "valid": false, + "evaluationPath": "/properties/foo/allOf/1", + "schemaLocation": + "https://json-schema.org/schemas/example#/properties/foo/allOf/1", + "instanceLocation": "/foo/foo-prop", + "nested": [ + { + "valid": false, + "evaluationPath": "/properties/foo/allOf/1/properties/foo-prop", + "schemaLocation": + "https://json-schema.org/schemas/example#/properties/foo/allOf/1/properties/foo-prop", + "instanceLocation": "/foo/foo-prop", + "errors": { + "const": "Expected the value \"1\"." + } + } + ] + } + ] + }, + { + "valid": false, + "evaluationPath": "/properties/bar", + "schemaLocation": + "https://json-schema.org/schemas/example#/properties/bar", + "instanceLocation": "/bar", + "nested": [ + { + "valid": false, + "evaluationPath": "/properties/bar/$ref", + "schemaLocation": + "https://json-schema.org/schemas/example#/$defs/bar", + "instanceLocation": "/bar", + "nested": [ + { + "valid": false, + "evaluationPath": "/properties/bar/$ref/properties/bar-prop", + "schemaLocation": + "https://json-schema.org/schemas/example#/$defs/bar/properties/bar-prop", + "instanceLocation": "/bar/bar-prop", + "errors": { + "type": "Expected a value of type \"integer\"." + } + } + ] + } + ] + } + ] + } + ]]>
diff --git a/output/verbose-example.json b/output/verbose-example.json deleted file mode 100644 index d74c10ea..00000000 --- a/output/verbose-example.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "valid": false, - "evaluationPath": "", - "instanceLocation": "", - "nested": [ - { - "valid": true, - "evaluationPath": "/$defs", - "instanceLocation": "" - }, - { - "valid": true, - "evaluationPath": "/type", - "instanceLocation": "" - }, - { - "valid": false, - "evaluationPath": "/items", - "instanceLocation": "", - "nested": [ - { - "valid": true, - "evaluationPath": "/items/$ref", - "schemaLocation": - "https://example.com/polygon#/items/$ref", - "instanceLocation": "/0", - "nested": [ - { - "valid": true, - "evaluationPath": "/items/$ref", - "schemaLocation": - "https://example.com/polygon#/$defs/point", - "instanceLocation": "/0", - "nested": [ - { - "valid": true, - "evaluationPath": "/items/$ref/type", - "schemaLocation": - "https://example.com/polygon#/$defs/point/type", - "instanceLocation": "/0" - }, - { - "valid": true, - "evaluationPath": "/items/$ref/properties", - "schemaLocation": - "https://example.com/polygon#/$defs/point/properties", - "instanceLocation": "/0" - }, - { - "valid": true, - "evaluationPath": "/items/$ref/required", - "schemaLocation": - "https://example.com/polygon#/$defs/point/required", - "instanceLocation": "/0" - }, - { - "valid": true, - "evaluationPath": "/items/$ref/additionalProperties", - "schemaLocation": - "https://example.com/polygon#/$defs/point/additionalProperties", - "instanceLocation": "/0" - } - ] - } - ] - }, - { - "valid": false, - "evaluationPath": "/items/$ref", - "schemaLocation": - "https://example.com/polygon#/items/$ref", - "instanceLocation": "/1", - "nested": [ - { - "valid": false, - "evaluationPath": "/items/$ref", - "schemaLocation": - "https://example.com/polygon#/$defs/point", - "instanceLocation": "/1", - "nested": [ - { - "valid": true, - "evaluationPath": "/items/$ref/type", - "schemaLocation": - "https://example.com/polygon#/$defs/point/type", - "instanceLocation": "/1" - }, - { - "valid": true, - "evaluationPath": "/items/$ref/properties", - "schemaLocation": - "https://example.com/polygon#/$defs/point/properties", - "instanceLocation": "/1" - }, - { - "valid": false, - "evaluationPath": "/items/$ref/required", - "schemaLocation": - "https://example.com/polygon#/$defs/point/required", - "instanceLocation": "/1" - }, - { - "valid": false, - "evaluationPath": "/items/$ref/additionalProperties", - "schemaLocation": - "https://example.com/polygon#/$defs/point/additionalProperties", - "instanceLocation": "/1", - "nested": [ - { - "valid": false, - "evaluationPath": "/items/$ref/additionalProperties", - "schemaLocation": - "https://example.com/polygon#/$defs/point/additionalProperties", - "instanceLocation": "/1/z" - } - ] - } - ] - } - ] - } - ] - }, - { - "valid": false, - "evaluationPath": "/minItems", - "instanceLocation": "" - } - ] -} From b4ff06ecb0a8f2dc02ca165d9a23086357802639 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Tue, 28 Jun 2022 11:36:10 +1200 Subject: [PATCH 04/13] removed 'detailed' format; added annotations examples; some rewording and clarifications --- jsonschema-core.xml | 273 +++++++++++++++++++++++++++++--------------- 1 file changed, 180 insertions(+), 93 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index c413d439..4cabedd3 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2726,18 +2726,18 @@ Basic - Provides validation information in a flat list structure. - Detailed - Provides validation information in a condensed hierarchical - structure based on the structure of the schema. - - - Verbose - Provides validation information in an uncondensed hierarchical - structure that matches the exact structure of the schema. + Hierarchical - Provides validation information in a hierarchical + structure that mimics the structure of the schema. + + To be precise, this structure follows the paths that a validator + would traverse while processing the schema, including composition + via by-reference keywords. + - An implementation SHOULD provide at least one of the "flag", "basic", or "detailed" - format and MAY provide the "verbose" format. If it provides one or more of the - "detailed" or "verbose" formats, it MUST also provide the "flag" format. - Implementations SHOULD specify in their documentation which formats they support. + An implementation MUST provide the "flag" format and SHOULD provide at least one + of the "basic" or "hierarchical" formats. Implementations SHOULD specify in + their documentation which formats they support.
@@ -2824,7 +2824,7 @@ https://example.com/schemas/common#/$defs/count/minimum Any errors produced by the validation. This property MUST NOT be included if the validation was successful. The value - for this property is an object where the keys are the names of + for this property MUST be an object where the keys are the names of keywords and the values are the error message produced by the associated keyword. If the subschema itself is producing the error, that error MUST be listed with an empty string key. @@ -2842,7 +2842,7 @@ https://example.com/schemas/common#/$defs/count/minimum Any annotations produced by the validation. This property MUST NOT be included if the validation was unsuccessful. The value - for this property is an object where the keys are the names of + for this property MUST be an object where the keys are the names of keywords and the values are the annotations produced by the associated keyword. @@ -2856,13 +2856,20 @@ https://example.com/schemas/common#/$defs/count/minimum
+ + Nested results are generated from applicator keywords: keywords with + subschemas or collections of subschemas as values. Keywords which + have arrays of subschemas (e.g. "anyOf") will generally generate an output + unit for each subschema. In order to accommodate potentially multiple + results, the value of this property MUST be an array of output units. + For "basic", this property will appear only at the root output unit - and will hold all results in a flat list. + and will hold all output units in a flat list. - For "detailed" and "verbose", this property will hold nested results - in a tree structure, mimicking that of the schema. + For "hierarchical", this property will hold nested results in a tree + structure, mimicking that of the schema. The sequence of output units within this list is not specified and @@ -3016,18 +3023,18 @@ https://example.com/schemas/common#/$defs/count/minimum by following the path "/properties/foo/allOf/1" will produce ["foo-prop"]. - - The keyword "title" - validated at "/properties/foo/allOf/1/properties/foo-prop" - by following the path "/properties/foo/allOf/1/properties/foo-prop" - will produce "foo-prop-title". - The keyword "additionalProperties" validated at "/properties/foo/allOf/1" by following the path "/properties/foo/allOf/1" will produce ["unspecified-prop"]. + + The keyword "title" + validated at "/properties/foo/allOf/1/properties/foo-prop" + by following the path "/properties/foo/allOf/1/properties/foo-prop" + will produce "foo-prop-title". + The keyword "title" validated at "/$defs/bar" @@ -3085,9 +3092,9 @@ https://example.com/schemas/common#/$defs/count/minimum omitted from the root output unit. - Intermediate output units, which do not themselves produce errors but - represent subschemas that contain error-producing subschemas, MAY be - included. + Output units which do not contain errors or annotations SHOULD be excluded + from this format, however implementations MAY choose to include them for + completeness.
@@ -3125,78 +3132,72 @@ https://example.com/schemas/common#/$defs/count/minimum } ] } -]]> - -
-
-
- - The "Detailed" format is a hierarchical structure based on that of the schema - and can be more readable for both humans and machines by grouping together - output units that apply to the same subschemas. - - - The root output unit contains "valid" for the overall result and "nested" - for the list of specific results. All other information is explicitly - omitted from the root output unit. - - - The following rules govern the construction of the results object: - - - All applicator keywords ("*Of", "$ref", "if"/"then"/"else", etc.) require - a output unit. - - - Output units that have no children are removed. - - - Output units that have a single child are replaced by the child. - - - Branch output units do not require an error message or an annotation. - -
- -
-
+
+ + The "Hierarchical" structure is a tree structure that follows the + evaluation path during the validation process. Typically, it will + resemble the schema as if all referenced schemas were bundled in place + of their associated by-reference keywords. + - The "Verbose" structure is a fully realized hierarchy that exactly matches - that of the schema. This structure has applications in form generation and - validation where the error's location is important. + All output units are included in this format. - The primary difference between this and the "Detailed" structure is that - all results are returned. This includes subschema validation results that - would otherwise be removed (e.g. passing subschemas contained within failing - subschemas, etc.). Because of this, each output unit MUST also carry a - "valid" property to indicate its local validation result. + The location properties of the output unit MAY be omitted from the + root node.
+ + // passing results (annotations) + { + "valid": true, + "annotations": { + "title": "root", + "properties": [ "foo", "bar" ] + }, + "nested": [ + { + "valid": true, + "evaluationPath": "/properties/foo", + "schemaLocation": + "https://json-schema.org/schemas/example#/properties/foo", + "instanceLocation": "/foo", + "annotations": { + "title": "foo-title" + }, + "nested": [ + { + "valid": true, + "evaluationPath": "/properties/foo/allOf/0", + "schemaLocation": + "https://json-schema.org/schemas/example#/properties/foo/allOf/0", + "instanceLocation": "/foo" + }, + { + "valid": true, + "evaluationPath": "/properties/foo/allOf/1", + "schemaLocation": + "https://json-schema.org/schemas/example#/properties/foo/allOf/1", + "instanceLocation": "/foo/foo-prop", + "annotations": { + "properties": [ "foo-prop" ], + "additionalProperties": [ "unspecified-prop" ] + }, + "nested": [ + { + "valid": true, + "evaluationPath": "/properties/foo/allOf/1/properties/foo-prop", + "schemaLocation": + "https://json-schema.org/schemas/example#/properties/foo/allOf/1/properties/foo-prop", + "instanceLocation": "/foo/foo-prop", + "annotations": { + "title": "foo-prop-title" + } + } + ] + } + ] + }, + { + "valid": true, + "evaluationPath": "/properties/bar", + "schemaLocation": + "https://json-schema.org/schemas/example#/properties/bar", + "instanceLocation": "/bar", + "nested": [ + { + "valid": true, + "evaluationPath": "/properties/bar/$ref", + "schemaLocation": + "https://json-schema.org/schemas/example#/$defs/bar", + "instanceLocation": "/bar", + "annotations": { + "title": "bar-title", + "properties": [ "bar-prop" ] + }, + "nested": [ + { + "valid": true, + "evaluationPath": "/properties/bar/$ref/properties/bar-prop", + "schemaLocation": + "https://json-schema.org/schemas/example#/$defs/bar/properties/bar-prop", + "instanceLocation": "/bar/bar-prop", + "annotations": { + "title": "bar-prop-title" + } + } + ] + } + ] + } + ] +} +]]>
From 997bed9b09a918f28dd023d1c16fa14ceadb2a49 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Wed, 29 Jun 2022 12:05:13 +1200 Subject: [PATCH 05/13] updated description of nested results --- jsonschema-core.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 4cabedd3..3dbfe5e4 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2869,11 +2869,12 @@ https://example.com/schemas/common#/$defs/count/minimum For "hierarchical", this property will hold nested results in a tree - structure, mimicking that of the schema. + structure where each output unit may itself have nested results. The sequence of output units within this list is not specified and - may be determined by the implementation. + MAY be determined by the implementation. Sets of output units are + considered equivalent if they contain the same units, in any order. The JSON key for nested results is "nested". From e1344ccff5a4de22fa17f40675600a674c18ba29 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Thu, 30 Jun 2022 18:28:37 +1200 Subject: [PATCH 06/13] use actual generated output for the examples --- jsonschema-core.xml | 282 +++++++++++++++++++++++--------------------- 1 file changed, 147 insertions(+), 135 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 3dbfe5e4..51182184 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -3103,32 +3103,35 @@ https://example.com/schemas/common#/$defs/count/minimum // failing results { "valid": false, + "evaluationPath": "", + "schemaLocation": "https://json-schema.org/schemas/example#", + "instanceLocation": "", "nested": [ { - "evaluationPath": "/properties/foo/allOf/0", - "schemaLocation": - "https://json-schema.org/schemas/example#/properties/foo/allOf/0", + "valid": false, + "evaluationPath": "/properties/foo/0", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/0", "instanceLocation": "/foo", "errors": { - "type": "Expected the property \"unspecified-prop\"." + "required": "Required properties [\"unspecified-prop\"] were not present" } }, { - "evaluationPath": "/properties/foo/allOf/1/properties/foo-prop", - "schemaLocation": - "https://json-schema.org/schemas/example#/properties/foo/allOf/1/properties/foo-prop", + "valid": false, + "evaluationPath": "/properties/foo/1/properties/foo-prop", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/1/properties/foo-prop", "instanceLocation": "/foo/foo-prop", "errors": { - "type": "Expected the value \"1\"." + "const": "Expected \"1\"" } }, { + "valid": false, "evaluationPath": "/properties/bar/$ref/properties/bar-prop", - "schemaLocation": - "https://json-schema.org/schemas/example#/$defs/bar/properties/bar-prop", + "schemaLocation": "https://json-schema.org/schemas/example#/$defs/bar/properties/bar-prop", "instanceLocation": "/bar/bar-prop", "errors": { - "type": "Expected a value of type \"integer\"." + "minimum": "2 is less than or equal to 10" } } ] @@ -3137,65 +3140,63 @@ https://example.com/schemas/common#/$defs/count/minimum // passing results { "valid": true, + "evaluationPath": "", + "schemaLocation": "https://json-schema.org/schemas/example#", + "instanceLocation": "", "nested": [ { "valid": true, "evaluationPath": "", - "schemaLocation": - "https://json-schema.org/schemas/example#", + "schemaLocation": "https://json-schema.org/schemas/example#", "instanceLocation": "", "annotations": { "title": "root", - "properties": [ "foo", "bar" ] + "properties": [ + "foo", + "bar" + ] } }, { "valid": true, - "evaluationPath": "/properties/foo", - "schemaLocation": - "https://json-schema.org/schemas/example#/properties/foo", + "evaluationPath": "/properties/foo/1", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/1", "instanceLocation": "/foo", "annotations": { - "title": "foo-title" + "title": "foo-title", + "properties": [ + "foo-prop" + ], + "additionalProperties": [ + "unspecified-prop" + ] } }, { "valid": true, - "evaluationPath": "/properties/foo/allOf/1", - "schemaLocation": - "https://json-schema.org/schemas/example#/properties/foo/allOf/1", - "instanceLocation": "/foo/foo-prop", + "evaluationPath": "/properties/bar/$ref", + "schemaLocation": "https://json-schema.org/schemas/example#/$defs/bar", + "instanceLocation": "/bar", "annotations": { - "properties": [ "foo-prop" ], - "additionalProperties": [ "unspecified-prop" ] + "title": "bar-title", + "properties": [ + "bar-prop" + ] } }, { "valid": true, - "evaluationPath": "/properties/foo/allOf/1/properties/foo-prop", - "schemaLocation": - "https://json-schema.org/schemas/example#/properties/foo/allOf/1/properties/foo-prop", + "evaluationPath": "/properties/foo/1/properties/foo-prop", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/1/properties/foo-prop", "instanceLocation": "/foo/foo-prop", "annotations": { "title": "foo-prop-title" } }, - { - "valid": true, - "evaluationPath": "/properties/bar/$ref", - "schemaLocation": - "https://json-schema.org/schemas/example#/$defs/bar", - "instanceLocation": "/bar", - "annotations": { - "title": "bar-title", - "properties": [ "bar-prop" ] - } - }, { "valid": true, "evaluationPath": "/properties/bar/$ref/properties/bar-prop", - "schemaLocation": - "https://json-schema.org/schemas/example#/$defs/bar/properties/bar-prop", + "schemaLocation": "https://json-schema.org/schemas/example#/$defs/bar/properties/bar-prop", "instanceLocation": "/bar/bar-prop", "annotations": { "title": "bar-prop-title" @@ -3227,122 +3228,134 @@ https://example.com/schemas/common#/$defs/count/minimum Date: Fri, 1 Jul 2022 20:55:30 +1200 Subject: [PATCH 07/13] fix URIs and remove location props from root node on basic --- jsonschema-core.xml | 61 +++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 51182184..2c93e40d 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -3090,7 +3090,9 @@ https://example.com/schemas/common#/$defs/count/minimum The root output unit contains "valid" for the overall result and "nested" for the list of specific results. All other information is explicitly - omitted from the root output unit. + omitted from the root output unit. If the root schema produces errors or + annotations, then the output node for the root MUST be present within the + root output unit's "nested" list with those errors or annotations. Output units which do not contain errors or annotations SHOULD be excluded @@ -3103,14 +3105,11 @@ https://example.com/schemas/common#/$defs/count/minimum // failing results { "valid": false, - "evaluationPath": "", - "schemaLocation": "https://json-schema.org/schemas/example#", - "instanceLocation": "", "nested": [ { "valid": false, - "evaluationPath": "/properties/foo/0", - "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/0", + "evaluationPath": "/properties/foo/allOf/0", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/allOf/0", "instanceLocation": "/foo", "errors": { "required": "Required properties [\"unspecified-prop\"] were not present" @@ -3118,8 +3117,8 @@ https://example.com/schemas/common#/$defs/count/minimum }, { "valid": false, - "evaluationPath": "/properties/foo/1/properties/foo-prop", - "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/1/properties/foo-prop", + "evaluationPath": "/properties/foo/allOf/1/properties/foo-prop", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/allOf/1/properties/foo-prop", "instanceLocation": "/foo/foo-prop", "errors": { "const": "Expected \"1\"" @@ -3140,9 +3139,6 @@ https://example.com/schemas/common#/$defs/count/minimum // passing results { "valid": true, - "evaluationPath": "", - "schemaLocation": "https://json-schema.org/schemas/example#", - "instanceLocation": "", "nested": [ { "valid": true, @@ -3159,8 +3155,8 @@ https://example.com/schemas/common#/$defs/count/minimum }, { "valid": true, - "evaluationPath": "/properties/foo/1", - "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/1", + "evaluationPath": "/properties/foo/allOf/1", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/allOf/1", "instanceLocation": "/foo", "annotations": { "title": "foo-title", @@ -3186,8 +3182,8 @@ https://example.com/schemas/common#/$defs/count/minimum }, { "valid": true, - "evaluationPath": "/properties/foo/1/properties/foo-prop", - "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/1/properties/foo-prop", + "evaluationPath": "/properties/foo/allOf/1/properties/foo-prop", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/allOf/1/properties/foo-prop", "instanceLocation": "/foo/foo-prop", "annotations": { "title": "foo-prop-title" @@ -3220,8 +3216,7 @@ https://example.com/schemas/common#/$defs/count/minimum All output units are included in this format. - The location properties of the output unit MAY be omitted from the - root node. + The location properties of the root output unit MAY be omitted.
@@ -3241,8 +3236,8 @@ https://example.com/schemas/common#/$defs/count/minimum "nested": [ { "valid": false, - "evaluationPath": "/properties/foo/0", - "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/0", + "evaluationPath": "/properties/foo/allOf/0", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/allOf/0", "instanceLocation": "/foo", "errors": { "required": "Required properties [\"unspecified-prop\"] were not present" @@ -3250,14 +3245,14 @@ https://example.com/schemas/common#/$defs/count/minimum }, { "valid": false, - "evaluationPath": "/properties/foo/1", - "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/1", + "evaluationPath": "/properties/foo/allOf/1", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/allOf/1", "instanceLocation": "/foo", "nested": [ { "valid": false, - "evaluationPath": "/properties/foo/1/properties/foo-prop", - "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/1/properties/foo-prop", + "evaluationPath": "/properties/foo/allOf/1/properties/foo-prop", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/allOf/1/properties/foo-prop", "instanceLocation": "/foo/foo-prop", "errors": { "const": "Expected \"1\"" @@ -3265,8 +3260,8 @@ https://example.com/schemas/common#/$defs/count/minimum }, { "valid": true, - "evaluationPath": "/properties/foo/1/additionalProperties/other-prop", - "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/1/additionalProperties/other-prop", + "evaluationPath": "/properties/foo/allOf/1/additionalProperties", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/allOf/1/additionalProperties", "instanceLocation": "/foo/other-prop" } ] @@ -3323,14 +3318,14 @@ https://example.com/schemas/common#/$defs/count/minimum "nested": [ { "valid": true, - "evaluationPath": "/properties/foo/0", - "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/0", + "evaluationPath": "/properties/foo/allOf/0", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/allOf/0", "instanceLocation": "/foo" }, { "valid": true, - "evaluationPath": "/properties/foo/1", - "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/1", + "evaluationPath": "/properties/foo/allOf/1", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/allOf/1", "instanceLocation": "/foo", "annotations": { "title": "foo-title", @@ -3344,8 +3339,8 @@ https://example.com/schemas/common#/$defs/count/minimum "nested": [ { "valid": true, - "evaluationPath": "/properties/foo/1/properties/foo-prop", - "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/1/properties/foo-prop", + "evaluationPath": "/properties/foo/allOf/1/properties/foo-prop", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/allOf/1/properties/foo-prop", "instanceLocation": "/foo/foo-prop", "annotations": { "title": "foo-prop-title" @@ -3353,8 +3348,8 @@ https://example.com/schemas/common#/$defs/count/minimum }, { "valid": true, - "evaluationPath": "/properties/foo/1/additionalProperties/unspecified-prop", - "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/1/additionalProperties/unspecified-prop", + "evaluationPath": "/properties/foo/allOf/1/additionalProperties", + "schemaLocation": "https://json-schema.org/schemas/example#/properties/foo/allOf/1/additionalProperties", "instanceLocation": "/foo/unspecified-prop" } ] From 0d7b83659e97c8664ca30be2ae4022e1244fb062 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Wed, 27 Jul 2022 13:31:25 +1200 Subject: [PATCH 08/13] edits suggested by @handrews --- jsonschema-core.xml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 2c93e40d..2169bc2a 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2756,11 +2756,11 @@ Implementations MAY elect to provide additional information. -
+
- The relative location of the validating subschema that follows the path - traversed through the schema. The value MUST be expressed as a JSON - Pointer, and it MUST include any by-reference applicators such as + The location of the schema resource that produced the output unit, represented + by the path traversed during evaluation. The value MUST be expressed as a + JSON Pointer, and it MUST include any by-reference applicators such as "$ref" or "$dynamicRef". The schema may not actually have a value at the location indicated @@ -2784,12 +2784,13 @@
-
+
- The absolute, dereferenced location of the validating subschema. The value MUST - be expressed as a full IRI using the canonical IRI of the relevant - schema object, and it MUST NOT include by-reference applicators - such as "$ref" or "$dynamicRef" as path components. + The absolute, dereferenced location of the schema resource that produced + the output unit. The value MUST be expressed using the canonical IRI of the + relevant schema resource plus a JSON Pointer fragment that indicates the contained + subschema that produced the output. It MUST NOT include by-reference applicators + such as "$ref" or "$dynamicRef". Note that "absolute" here is in the sense of "absolute filesystem path" (meaning the complete location) rather than the "absolute-IRI" @@ -2857,11 +2858,12 @@ https://example.com/schemas/common#/$defs/count/minimum
- Nested results are generated from applicator keywords: keywords with - subschemas or collections of subschemas as values. Keywords which - have arrays of subschemas (e.g. "anyOf") will generally generate an output - unit for each subschema. In order to accommodate potentially multiple - results, the value of this property MUST be an array of output units. + Nested results are generated from keywords which create a new dynamic + scope by applying a subschema to the instance or a child of the instance. + Keywords which have multiple subschemas (e.g. "anyOf") will generally + generate an output unit for each subschema. In order to accommodate + potentially multiple results, the value of this property MUST be an + array of output units, even if only a single output unit is produced. For "basic", this property will appear only at the root output unit From fe67355341613c4f2ad60c33064e56489da3956b Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Thu, 4 Aug 2022 15:47:31 +1200 Subject: [PATCH 09/13] using 'dereferenced evaluation structure --- jsonschema-core.xml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 2169bc2a..f0532031 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2727,12 +2727,7 @@ Hierarchical - Provides validation information in a hierarchical - structure that mimics the structure of the schema. - - To be precise, this structure follows the paths that a validator - would traverse while processing the schema, including composition - via by-reference keywords. - + structure that mimics the dereferenced evaluation structure of the schema. An implementation MUST provide the "flag" format and SHOULD provide at least one From 509ed28de2b15e3c7bdcff8444a6358cd580fd06 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Fri, 5 Aug 2022 07:50:40 +1200 Subject: [PATCH 10/13] more verbiage tweaks to output --- jsonschema-core.xml | 57 ++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index f0532031..5d2ec745 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2727,7 +2727,8 @@ Hierarchical - Provides validation information in a hierarchical - structure that mimics the dereferenced evaluation structure of the schema. + structure that follows the evaluation paths generated while processing + the schema. An implementation MUST provide the "flag" format and SHOULD provide at least one @@ -2753,10 +2754,9 @@
- The location of the schema resource that produced the output unit, represented - by the path traversed during evaluation. The value MUST be expressed as a - JSON Pointer, and it MUST include any by-reference applicators such as - "$ref" or "$dynamicRef". + The evalutaion path to the schema object that produced the output unit. + The value MUST be expressed as a JSON Pointer, and it MUST include any + by-reference applicators such as "$ref" or "$dynamicRef". The schema may not actually have a value at the location indicated by this pointer. It is provided as an indication of the traversal @@ -2779,19 +2779,19 @@
-
+
- The absolute, dereferenced location of the schema resource that produced + The absolute, dereferenced location of the schema object that produced the output unit. The value MUST be expressed using the canonical IRI of the - relevant schema resource plus a JSON Pointer fragment that indicates the contained - subschema that produced the output. It MUST NOT include by-reference applicators + relevant schema resource plus a JSON Pointer fragment that indicates the schema + object that produced the output. It MUST NOT include by-reference applicators such as "$ref" or "$dynamicRef". Note that "absolute" here is in the sense of "absolute filesystem path" (meaning the complete location) rather than the "absolute-IRI" - terminology from RFC 3987 (meaning with scheme but without fragment). - Keyword absolute locations will have a fragment in order to - identify the keyword. + terminology from RFC 3987 (meaning with scheme and without fragment). + Schema locations will have a fragment in order to identify the specific + schema object.
@@ -2844,7 +2844,7 @@ https://example.com/schemas/common#/$defs/count/minimum Each keyword defines its own annotation data type (e.g. "properties" - produces a list of keywords, whereas "$title" produces a string). + produces a list of keywords, whereas "title" produces a string). The JSON key for this information is "annotations". @@ -2887,11 +2887,10 @@ https://example.com/schemas/common#/$defs/count/minimum "nested" as described below. - "valid" - a boolean value indicating the overall validation success or - failure + "valid" - a boolean value indicating the overall validation success or failure - "nested" - the collection of errors or annotations produced by a subschema + "nested" - the collection of results produced by subschemas For these examples, the following schema and instances will be used. @@ -2963,21 +2962,21 @@ https://example.com/schemas/common#/$defs/count/minimum The value at "/foo" - validated at "/properties/foo/allOf/0" + evaluated at "/properties/foo/allOf/0" by following the path "/properties/foo/allOf/0" by the "required" keyword is missing the property "unspecified-prop". The value at "/foo/foo-prop" - validated at "/properties/foo/allOf/1/properties/foo-prop" + evaluated at "/properties/foo/allOf/1/properties/foo-prop" by following the path "/properties/foo/allOf/1/properties/foo-prop" by the "const" keyword is not the constant value 1. The value at "/bar/bar-prop" - validated at "/$defs/bar/properties/bar-prop" + evaluated at "/$defs/bar/properties/bar-prop" by following the path "/properties/bar/$ref/properties/bar-prop" by the "type" keyword is not a number. @@ -2999,55 +2998,55 @@ https://example.com/schemas/common#/$defs/count/minimum The keyword "title" - validated at "" + evaluated at "" by following the path "" will produce "root". The keyword "properties" - validated at "" + evaluated at "" by following the path "" will produce ["foo", "bar"]. The keyword "title" - validated at "/properties/foo" + evaluated at "/properties/foo" by following the path "/properties/foo" will produce "foo-title". The keyword "properties" - validated at "/properties/foo/allOf/1" + evaluated at "/properties/foo/allOf/1" by following the path "/properties/foo/allOf/1" will produce ["foo-prop"]. The keyword "additionalProperties" - validated at "/properties/foo/allOf/1" + evaluated at "/properties/foo/allOf/1" by following the path "/properties/foo/allOf/1" will produce ["unspecified-prop"]. The keyword "title" - validated at "/properties/foo/allOf/1/properties/foo-prop" + evaluated at "/properties/foo/allOf/1/properties/foo-prop" by following the path "/properties/foo/allOf/1/properties/foo-prop" will produce "foo-prop-title". The keyword "title" - validated at "/$defs/bar" + evaluated at "/$defs/bar" by following the path "/properties/bar/$ref" will produce "bar-title". The keyword "properties" - validated at "/$defs/bar" + evaluated at "/$defs/bar" by following the path "/properties/var/$ref" will produce ["bar-prop"]. The keyword "title" - validated at "/$defs/bar/properties/bar-prop" + evaluated at "/$defs/bar/properties/bar-prop" by following the path "/properties/bar/$ref/properties/bar-prop" will produce "bar-prop-title". @@ -3206,7 +3205,7 @@ https://example.com/schemas/common#/$defs/count/minimum The "Hierarchical" structure is a tree structure that follows the evaluation path during the validation process. Typically, it will - resemble the schema as if all referenced schemas were bundled in place + resemble the schema as if all referenced schemas were inlined in place of their associated by-reference keywords. From b6799cd4ff8336318d74cfc80b09d43c2042710a Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Fri, 5 Aug 2022 09:45:55 +1200 Subject: [PATCH 11/13] correcting the number of output formats --- jsonschema-core.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 5d2ec745..5970e166 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2715,7 +2715,7 @@
- This specification defines four output formats. See the "Output Structure" + This specification defines three output formats. See the "Output Structure" section for the requirements of each format. From 843a6833a4393d1292820fdeed4ee7b3d4e77b24 Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Fri, 5 Aug 2022 13:32:34 +1200 Subject: [PATCH 12/13] update example locations for evaluationPath and schemaLocation --- jsonschema-core.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 5970e166..1693e9d4 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2766,7 +2766,7 @@
@@ -2797,7 +2797,7 @@
From b6ea8a341e775c749254b8e00e46e2a7ef951a6a Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Mon, 15 Aug 2022 08:47:13 +1200 Subject: [PATCH 13/13] add clarification around empty-string error messages --- jsonschema-core.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index 1693e9d4..d6e58dad 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2822,8 +2822,18 @@ https://example.com/schemas/common#/$defs/allOf/1 be included if the validation was successful. The value for this property MUST be an object where the keys are the names of keywords and the values are the error message produced by the - associated keyword. If the subschema itself is producing the - error, that error MUST be listed with an empty string key. + associated keyword. +
+ + If the subschema itself is producing the error, that error MUST be + listed with an empty string key. + + Although there may be other cases where a subschema can produce + an error, the most common case is the "false" schema. In + cases like these, there is no keyword that produces the error, + so there is nothing to use as a key. Thus the empty string + is used instead. + The specific wording for the message is not defined by this