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
- 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
94
+
1.The following will be added to the JSON Schema Core specification as a
95
95
subsection of "Keywords for Applying Subschemas Conditionally".
96
96
> ### `propertyDependencies`
97
97
>
98
98
> This keyword specifies subschemas that are evaluated if the instance is an
99
99
> object and contains a certain property with a certain string value.
100
100
>
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.
101
+
> This keyword's value MUST be an object. Each value in the object MUST be
102
+
> an object whose values MUST be valid JSON Schemas.
103
103
>
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.
104
+
> If the outer object key is a property in the instance and the inner object
105
+
> key is equal to the value of that property, the entire instance must
106
+
> validate against the schema. Its use is dependent on the presence and
107
+
> value of the property.
108
108
>
109
109
> 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`:
110
+
111
+
2. The following subschema will be added to the Applicator Vocabulary schema,
112
+
`https://json-schema.org/<version>/<release>/meta/applicator` at
113
+
`/properties/propertyDependencies`:
114
+
111
115
```json
112
116
{
113
117
"type": "object",
@@ -124,9 +128,9 @@ subsection of "Keywords for Applying Subschemas Conditionally".
124
128
125
129
## [Appendix] Change Log
126
130
127
-
* [March 2021] - Initially proposed
128
-
* [October 2021] Added to specification document
129
-
* [May 2024] Extracted from specification document as experimental feature
131
+
-[March 2021] - Initially proposed
132
+
-[October 2021] Added to specification document
133
+
-[May 2024] Extracted from specification document as experimental feature
Copy file name to clipboardExpand all lines: proposals/vocabularies.md
+7-4
Original file line number
Diff line number
Diff line change
@@ -252,14 +252,17 @@ For example
252
252
```
253
253
-->
254
254
255
-
_**NOTE** Since the design of vocabularies will be changing anyway, it's not worth the time and effort to fill in this section just yet. As such, please read the above sections for loose requirements. For tighter requirements, please assume conformance with the 2020-12 Core and Validation specifications._
255
+
***NOTE** Since the design of vocabularies will be changing anyway, it's not
256
+
worth the time and effort to fill in this section just yet. As such, please
257
+
read the above sections for loose requirements. For tighter requirements,
258
+
please assume conformance with the 2020-12 Core and Validation specifications.*
0 commit comments