You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: jsonschema-validation-output-machines.md
+6-2
Original file line number
Diff line number
Diff line change
@@ -172,10 +172,14 @@ The failing instance will produce the following errors:
172
172
is not a number.
173
173
174
174
<!--
175
-
"minimum" doesn't produce an error because it only operates on instances that are numbers.
175
+
"minimum" doesn't produce an error because it only operates on instances that
176
+
are numbers.
176
177
-->
177
178
<!--
178
-
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.
179
+
Note that the error message wording as depicted in the examples below is not a
180
+
requirement of this specification. Implementations SHOULD craft error messages
181
+
tailored for their audience or provide a templating mechanism that allows their
182
+
users to craft their own messages.
179
183
-->
180
184
181
185
The passing instance will produce the following annotations:
- PR to add to the spec - <https://github.com/json-schema-org/json-schema-spec/pull/1143>
11
+
- ADR to extract from the spec and use feature life cycle - <https://github.com/json-schema-org/json-schema-spec/pull/1505>
12
+
13
+
## Table of Contents
12
14
13
15
## Context and Problem Statement
14
16
@@ -33,7 +35,8 @@ adopt or redefine `discriminator`.
33
35
34
36
## Considered Options
35
37
36
-
All of the following options have the same validation result as the following schema.
38
+
All of the following options have the same validation result as the following
39
+
schema.
37
40
38
41
```json
39
42
{
@@ -64,10 +67,10 @@ that concept to solve this problem.
64
67
}
65
68
```
66
69
67
-
* Good, because it handle the most common use case: string property values
68
-
* Good, because all property values are grouped together
69
-
* Good, because it's less verbose
70
-
* Bad, because it doesn't handle non-string property values
70
+
- Good, because it handle the most common use case: string property values
71
+
- Good, because all property values are grouped together
72
+
- Good, because it's less verbose
73
+
- Bad, because it doesn't handle non-string property values
71
74
72
75
### Option 2
73
76
@@ -97,7 +100,9 @@ prone.
97
100
* Good, because it supports all use cases
98
101
* Bad, because properties are not naturally grouped together
99
102
* Bad, because it's quite verbose
100
-
* Bad, because we have no precedent for a keyword which explicitly defines its own properties. This would be new operational functionality, which we try to avoid if we can.
103
+
* Bad, because we have no precedent for a keyword which explicitly defines its
104
+
own properties. This would be new operational functionality, which we try to
105
+
avoid if we can.
101
106
102
107
### Option 3
103
108
@@ -124,7 +129,9 @@ object. It's still too verbose.
124
129
* Good, because it supports all use cases
125
130
* Good, because all property values are grouped together
126
131
* Bad, because it's quite verbose
127
-
* Bad, because we have no precedent for a keyword which explicitly defines its own properties. This would be new operational functionality, which we try to avoid if we can.
132
+
* Bad, because we have no precedent for a keyword which explicitly defines its
133
+
own properties. This would be new operational functionality, which we try to
134
+
avoid if we can.
128
135
129
136
### Option 4
130
137
@@ -148,10 +155,11 @@ naming aside), but otherwise has all the same problems as the other examples.
148
155
}
149
156
```
150
157
151
-
* Good, because it supports all use cases
152
-
* Bad, because properties are not naturally grouped together
153
-
* Bad, because it's very verbose
154
-
* Bad, because it introduces a lot of inter-keyword dependencies, which we'd have to exhaustively define
158
+
- Good, because it supports all use cases
159
+
- Bad, because properties are not naturally grouped together
160
+
- Bad, because it's very verbose
161
+
- Bad, because it introduces a lot of inter-keyword dependencies, which we'd
162
+
have to exhaustively define
155
163
156
164
### Option 5
157
165
@@ -183,7 +191,8 @@ verbose.
183
191
* Good, because it's a familiar syntax
184
192
* Bad, because properties are not naturally grouped together
185
193
* Bad, because it's very verbose
186
-
* Bad, because `ifProperties` is very niche. Will this spawn a new series of `if*` keywords? How would it interact with `if`?
194
+
* Bad, because `ifProperties` is very niche. Will this spawn a new series of
1. The following will be added to the JSON Schema Core specification as a
96
+
1.The following will be added to the JSON Schema Core specification as a
95
97
subsection of "Keywords for Applying Subschemas Conditionally".
96
98
> ### `propertyDependencies`
97
99
>
98
100
> This keyword specifies subschemas that are evaluated if the instance is an
99
101
> object and contains a certain property with a certain string value.
100
102
>
101
-
> This keyword's value MUST be an object. Each value in the object MUST be an
102
-
> object whose values MUST be valid JSON Schemas.
103
+
> This keyword's value MUST be an object. Each value in the object MUST be
104
+
> an object whose values MUST be valid JSON Schemas.
103
105
>
104
-
> If the outer object key is a property in the instance and the inner object key
105
-
> is equal to the value of that property, the entire instance must validate
106
-
> against the schema. Its use is dependent on the presence and value of the
107
-
> property.
106
+
> If the outer object key is a property in the instance and the inner object
107
+
> key is equal to the value of that property, the entire instance must
108
+
> validate against the schema. Its use is dependent on the presence and
109
+
> value of the property.
108
110
>
109
111
> Omitting this keyword has the same behavior as an empty object.
110
-
2. The following subschema will be added to the Applicator Vocabulary schema, `https://json-schema.org/<version>/<release>/meta/applicator` at `/properties/propertyDependencies`:
112
+
113
+
2. The following subschema will be added to the Applicator Vocabulary schema,
114
+
`https://json-schema.org/<version>/<release>/meta/applicator` at
115
+
`/properties/propertyDependencies`:
116
+
111
117
```json
112
118
{
113
119
"type": "object",
@@ -124,9 +130,9 @@ subsection of "Keywords for Applying Subschemas Conditionally".
124
130
125
131
## [Appendix] Change Log
126
132
127
-
* [March 2021] - Initially proposed
128
-
* [October 2021] Added to specification document
129
-
* [May 2024] Extracted from specification document as experimental feature
133
+
-[March 2021] - Initially proposed
134
+
-[October 2021] Added to specification document
135
+
-[May 2024] Extracted from specification document as experimental feature
0 commit comments