2704
2704
2705
2705
<section title =" Keyword Relative Location" >
2706
2706
<t >
2707
- The relative location of the validating keyword that follows the validation
2708
- path. The value MUST be expressed as a JSON Pointer, and it MUST include
2709
- any by-reference applicators such as "$ref" or "$dynamicRef".
2707
+ The relative location of the validating keyword that follows the path
2708
+ traversed through the schema. The value MUST be expressed as a JSON
2709
+ Pointer, and it MUST include any by-reference applicators such as
2710
+ "$ref" or "$dynamicRef".
2711
+ <cref >
2712
+ The schema may not actually have a value at the location indicated
2713
+ by this pointer. It is provided as an indication of the traversal
2714
+ path only.
2715
+ </cref >
2710
2716
</t >
2711
2717
<figure >
2712
2718
<artwork >
2720
2726
due to the inclusion of these by-reference applicator keywords.
2721
2727
</t >
2722
2728
<t >
2723
- The JSON key for this information is "keywordLocation ".
2729
+ The JSON key for this information is "evaluationPath ".
2724
2730
</t >
2725
2731
</section >
2726
2732
@@ -2752,7 +2758,7 @@ https://example.com/schemas/common#/$defs/count/minimum
2752
2758
over a reference or if the schema does not declare an absolute IRI as its "$id".
2753
2759
</t >
2754
2760
<t >
2755
- The JSON key for this information is "absoluteKeywordLocation ".
2761
+ The JSON key for this information is "schemaLocation ".
2756
2762
</t >
2757
2763
</section >
2758
2764
@@ -2786,13 +2792,15 @@ https://example.com/schemas/common#/$defs/count/minimum
2786
2792
2787
2793
<section title =" Nested Results" >
2788
2794
<t >
2789
- For the two hierarchical structures, this property will hold nested errors
2790
- and annotations.
2795
+ For "basic", this property will appear only at the root node and will hold
2796
+ all errors or annotations in a list.
2797
+ </t >
2798
+ <t >
2799
+ For "detailed" and "verbose", this property will hold nested errors
2800
+ and annotations in a tree structure, mimicking that of the schema.
2791
2801
</t >
2792
2802
<t >
2793
- The JSON key for nested results in failed validations is "errors"; for
2794
- successful validations it is "annotations". Note the plural forms, as
2795
- a keyword with nested results can also have a local error or annotation.
2803
+ The JSON key for nested results is "nested".
2796
2804
</t >
2797
2805
</section >
2798
2806
@@ -2802,19 +2810,14 @@ https://example.com/schemas/common#/$defs/count/minimum
2802
2810
<t >
2803
2811
The output MUST be an object containing a boolean property named "valid". When
2804
2812
additional information about the result is required, the output MUST also contain
2805
- "errors" or "annotations " as described below.
2813
+ "nested " as described below.
2806
2814
<list >
2807
2815
<t >
2808
2816
"valid" - a boolean value indicating the overall validation success or
2809
2817
failure
2810
2818
</t >
2811
2819
<t >
2812
- "errors" - the collection of errors or annotations produced by a failed
2813
- validation
2814
- </t >
2815
- <t >
2816
- "annotations" - the collection of errors or annotations produced by a
2817
- successful validation
2820
+ "nested" - the collection of errors or annotations produced by a keyword
2818
2821
</t >
2819
2822
</list >
2820
2823
For these examples, the following schema and instance will be used.
@@ -2910,35 +2913,35 @@ https://example.com/schemas/common#/$defs/count/minimum
2910
2913
<![CDATA[
2911
2914
{
2912
2915
"valid": false,
2913
- "errors ": [
2916
+ "nested ": [
2914
2917
{
2915
- "keywordLocation ": "",
2918
+ "evaluationPath ": "",
2916
2919
"instanceLocation": "",
2917
2920
"error": "A subschema had errors."
2918
2921
},
2919
2922
{
2920
- "keywordLocation ": "/items/$ref",
2921
- "absoluteKeywordLocation ":
2923
+ "evaluationPath ": "/items/$ref",
2924
+ "schemaLocation ":
2922
2925
"https://example.com/polygon#/$defs/point",
2923
2926
"instanceLocation": "/1",
2924
2927
"error": "A subschema had errors."
2925
2928
},
2926
2929
{
2927
- "keywordLocation ": "/items/$ref/required",
2928
- "absoluteKeywordLocation ":
2930
+ "evaluationPath ": "/items/$ref/required",
2931
+ "schemaLocation ":
2929
2932
"https://example.com/polygon#/$defs/point/required",
2930
2933
"instanceLocation": "/1",
2931
2934
"error": "Required property 'y' not found."
2932
2935
},
2933
2936
{
2934
- "keywordLocation ": "/items/$ref/additionalProperties",
2935
- "absoluteKeywordLocation ":
2937
+ "evaluationPath ": "/items/$ref/additionalProperties",
2938
+ "schemaLocation ":
2936
2939
"https://example.com/polygon#/$defs/point/additionalProperties",
2937
2940
"instanceLocation": "/1/z",
2938
2941
"error": "Additional property 'z' found but was invalid."
2939
2942
},
2940
2943
{
2941
- "keywordLocation ": "/minItems",
2944
+ "evaluationPath ": "/minItems",
2942
2945
"instanceLocation": "",
2943
2946
"error": "Expected at least 3 items but found 2"
2944
2947
}
@@ -2979,28 +2982,28 @@ https://example.com/schemas/common#/$defs/count/minimum
2979
2982
<![CDATA[
2980
2983
{
2981
2984
"valid": false,
2982
- "keywordLocation ": "",
2985
+ "evaluationPath ": "",
2983
2986
"instanceLocation": "",
2984
- "errors ": [
2987
+ "nested ": [
2985
2988
{
2986
2989
"valid": false,
2987
- "keywordLocation ": "/items/$ref",
2988
- "absoluteKeywordLocation ":
2990
+ "evaluationPath ": "/items/$ref",
2991
+ "schemaLocation ":
2989
2992
"https://example.com/polygon#/$defs/point",
2990
2993
"instanceLocation": "/1",
2991
- "errors ": [
2994
+ "nested ": [
2992
2995
{
2993
2996
"valid": false,
2994
- "keywordLocation ": "/items/$ref/required",
2995
- "absoluteKeywordLocation ":
2997
+ "evaluationPath ": "/items/$ref/required",
2998
+ "schemaLocation ":
2996
2999
"https://example.com/polygon#/$defs/point/required",
2997
3000
"instanceLocation": "/1",
2998
3001
"error": "Required property 'y' not found."
2999
3002
},
3000
3003
{
3001
3004
"valid": false,
3002
- "keywordLocation ": "/items/$ref/additionalProperties",
3003
- "absoluteKeywordLocation ":
3005
+ "evaluationPath ": "/items/$ref/additionalProperties",
3006
+ "schemaLocation ":
3004
3007
"https://example.com/polygon#/$defs/point/additionalProperties",
3005
3008
"instanceLocation": "/1/z",
3006
3009
"error": "Additional property 'z' found but was invalid."
@@ -3009,7 +3012,7 @@ https://example.com/schemas/common#/$defs/count/minimum
3009
3012
},
3010
3013
{
3011
3014
"valid": false,
3012
- "keywordLocation ": "/minItems",
3015
+ "evaluationPath ": "/minItems",
3013
3016
"instanceLocation": "",
3014
3017
"error": "Expected at least 3 items but found 2"
3015
3018
}
@@ -3062,27 +3065,27 @@ https://example.com/schemas/common#/$defs/count/minimum
3062
3065
// result
3063
3066
{
3064
3067
"valid": false,
3065
- "keywordLocation ": "",
3068
+ "evaluationPath ": "",
3066
3069
"instanceLocation": "",
3067
- "errors ": [
3070
+ "nested ": [
3068
3071
{
3069
3072
"valid": true,
3070
- "keywordLocation ": "/type",
3073
+ "evaluationPath ": "/type",
3071
3074
"instanceLocation": ""
3072
3075
},
3073
3076
{
3074
3077
"valid": true,
3075
- "keywordLocation ": "/properties",
3078
+ "evaluationPath ": "/properties",
3076
3079
"instanceLocation": ""
3077
3080
},
3078
3081
{
3079
3082
"valid": false,
3080
- "keywordLocation ": "/additionalProperties",
3083
+ "evaluationPath ": "/additionalProperties",
3081
3084
"instanceLocation": "",
3082
- "errors ": [
3085
+ "nested ": [
3083
3086
{
3084
3087
"valid": false,
3085
- "keywordLocation ": "/additionalProperties",
3088
+ "evaluationPath ": "/additionalProperties",
3086
3089
"instanceLocation": "/disallowedProp",
3087
3090
"error": "Additional property 'disallowedProp' found but was invalid."
3088
3091
}
0 commit comments