|
21 | 21 | <?rfc inline="yes" ?>
|
22 | 22 | <rfc category="info" docName="draft-wright-json-schema-validation-01" ipr="trust200902">
|
23 | 23 | <front>
|
24 |
| - <title abbrev="JSON Schema Validation">JSON Schema Validation: A Vocabulary for Structural Validation of JSON</title> |
| 24 | + <title abbrev="JSON Schema Validation"> |
| 25 | + JSON Schema Validation: A Vocabulary for Structural Validation of JSON |
| 26 | + </title> |
25 | 27 |
|
26 | 28 | <author fullname="Austin Wright" initials="A" surname="Wright" role="editor">
|
27 | 29 | <address>
|
|
50 | 52 |
|
51 | 53 | <abstract>
|
52 | 54 | <t>
|
53 |
| - JSON Schema (application/schema+json) has several purposes, one of which is JSON instance validation. |
54 |
| - This document specifies a vocabulary for JSON Schema to describe the meaning of JSON documents, |
55 |
| - provide hints for user interfaces working with JSON data, |
56 |
| - and to make assertions about what a valid document must look like. |
| 55 | + JSON Schema (application/schema+json) has several purposes, one of which is JSON |
| 56 | + instance validation. |
| 57 | + This document specifies a vocabulary for JSON Schema to describe the meaning of JSON |
| 58 | + documents, provide hints for user interfaces working with JSON data, and to make |
| 59 | + assertions about what a valid document must look like. |
57 | 60 | </t>
|
58 | 61 | </abstract>
|
59 | 62 |
|
60 | 63 | <note title="Note to Readers">
|
61 | 64 | <t>
|
62 |
| - The issues list for this draft can be found at <eref target="https://github.com/json-schema-org/json-schema-spec/issues"/>. |
| 65 | + The issues list for this draft can be found at |
| 66 | + <eref target="https://github.com/json-schema-org/json-schema-spec/issues"/>. |
63 | 67 | </t>
|
64 | 68 | <t>
|
65 | 69 | For additional information, see <eref target="http://json-schema.org/"/>.
|
66 | 70 | </t>
|
67 | 71 | <t>
|
68 |
| - To provide feedback, use this issue tracker, the communication methods listed on the homepage, or email the document editors. |
| 72 | + To provide feedback, use this issue tracker, the communication methods listed on the |
| 73 | + homepage, or email the document editors. |
69 | 74 | </t>
|
70 | 75 | </note>
|
71 | 76 | </front>
|
|
116 | 121 |
|
117 | 122 | <section title="Validation of numeric instances">
|
118 | 123 | <t>
|
119 |
| - The JSON specification allows numbers with arbitrary precision, and JSON Schema does not add any such bounds. |
| 124 | + The JSON specification allows numbers with arbitrary precision, and JSON Schema |
| 125 | + does not add any such bounds. |
120 | 126 | This means that numeric instances processed by JSON Schema can be arbitrarily large and/or
|
121 | 127 | have an arbitrarily long decimal part, regardless of the ability of the
|
122 | 128 | underlying programming language to deal with such data.
|
|
167 | 173 | validation succeeds.
|
168 | 174 | </t>
|
169 | 175 | <t>
|
170 |
| - For example, the "maxLength" keyword will only restrict certain strings (that are too long) from being valid. |
171 |
| - If the instance is a number, boolean, null, array, or object, the keyword passes validation. |
| 176 | + For example, the "maxLength" keyword will only restrict certain strings (that |
| 177 | + are too long) from being valid. |
| 178 | + If the instance is a number, boolean, null, array, or object, the keyword passes |
| 179 | + validation. |
172 | 180 | </t>
|
173 | 181 | </section>
|
174 | 182 |
|
|
204 | 212 | </t>
|
205 | 213 | <t>
|
206 | 214 | Validation keywords that are missing never restrict validation.
|
207 |
| - In some cases, this no-op behavior is identical to a keyword that exists with certain values, |
208 |
| - and these values are noted where known. |
| 215 | + In some cases, this no-op behavior is identical to a keyword that exists with |
| 216 | + certain values, and these values are noted where known. |
209 | 217 | </t>
|
210 | 218 | </section>
|
211 | 219 |
|
|
217 | 225 | <t>
|
218 | 226 | For schema author convenience, there are some exceptions:
|
219 | 227 | <list>
|
220 |
| - <t>"additionalProperties", whose behavior is defined in terms of "properties" and "patternProperties"; and</t> |
221 |
| - <t>"additionalItems", whose behavior is defined in terms of "items".</t> |
| 228 | + <t> |
| 229 | + "additionalProperties", whose behavior is defined in terms of |
| 230 | + "properties" and "patternProperties"; and |
| 231 | + </t> |
| 232 | + <t> |
| 233 | + "additionalItems", whose behavior is defined in terms of "items". |
| 234 | + </t> |
222 | 235 | </list>
|
223 | 236 | </t>
|
224 | 237 | </section>
|
|
227 | 240 |
|
228 | 241 | <section title="Meta-schema">
|
229 | 242 | <t>
|
230 |
| - The current URI for the JSON Schema Validation is <http://json-schema.org/draft-06/schema#>. |
| 243 | + The current URI for the JSON Schema Validation is |
| 244 | + <http://json-schema.org/draft-06/schema#>. |
231 | 245 | </t>
|
232 | 246 | </section>
|
233 | 247 |
|
234 | 248 | <section title="Validation keywords">
|
235 | 249 | <t>
|
236 |
| - Validation keywords in a schema impose requirements for successful validation of an instance. |
| 250 | + Validation keywords in a schema impose requirements for successful validation of an |
| 251 | + instance. |
237 | 252 | </t>
|
238 | 253 |
|
239 | 254 | <section title="multipleOf">
|
240 | 255 | <t>
|
241 | 256 | The value of "multipleOf" MUST be a number, strictly greater than 0.
|
242 | 257 | </t>
|
243 | 258 | <t>
|
244 |
| - A numeric instance is valid only if division by this keyword's value results in an integer. |
| 259 | + A numeric instance is valid only if division by this keyword's value results in |
| 260 | + an integer. |
245 | 261 | </t>
|
246 | 262 | </section>
|
247 | 263 |
|
248 | 264 | <section title="maximum">
|
249 | 265 | <t>
|
250 |
| - The value of "maximum" MUST be a number, representing an inclusive upper limit for a numeric instance. |
| 266 | + The value of "maximum" MUST be a number, representing an inclusive upper limit |
| 267 | + for a numeric instance. |
251 | 268 | </t>
|
252 | 269 | <t>
|
253 |
| - If the instance is a number, then this keyword validates only if the instance is less than or exactly equal to "maximum". |
| 270 | + If the instance is a number, then this keyword validates only if the instance is |
| 271 | + less than or exactly equal to "maximum". |
254 | 272 | </t>
|
255 | 273 | </section>
|
256 | 274 |
|
257 | 275 | <section title="exclusiveMaximum">
|
258 | 276 | <t>
|
259 |
| - The value of "exclusiveMaximum" MUST be number, representing an exclusive upper limit for a numeric instance. |
| 277 | + The value of "exclusiveMaximum" MUST be number, representing an exclusive upper |
| 278 | + limit for a numeric instance. |
260 | 279 | </t>
|
261 | 280 | <t>
|
262 |
| - If the instance is a number, then the instance is valid only if it has a value strictly less than (not equal to) "exclusiveMaximum". |
| 281 | + If the instance is a number, then the instance is valid only if it has a value |
| 282 | + strictly less than (not equal to) "exclusiveMaximum". |
263 | 283 | </t>
|
264 | 284 | </section>
|
265 | 285 |
|
266 | 286 | <section title="minimum">
|
267 | 287 | <t>
|
268 |
| - The value of "minimum" MUST be a number, representing an inclusive upper limit for a numeric instance. |
| 288 | + The value of "minimum" MUST be a number, representing an inclusive upper limit |
| 289 | + for a numeric instance. |
269 | 290 | </t>
|
270 | 291 | <t>
|
271 |
| - If the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to "minimum". |
| 292 | + If the instance is a number, then this keyword validates only if the instance is |
| 293 | + greater than or exactly equal to "minimum". |
272 | 294 | </t>
|
273 | 295 | </section>
|
274 | 296 |
|
275 | 297 | <section title="exclusiveMinimum">
|
276 | 298 | <t>
|
277 |
| - The value of "exclusiveMinimum" MUST be number, representing an exclusive upper limit for a numeric instance. |
| 299 | + The value of "exclusiveMinimum" MUST be number, representing an exclusive upper |
| 300 | + limit for a numeric instance. |
278 | 301 | </t>
|
279 | 302 | <t>
|
280 |
| - If the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to) "exclusiveMinimum". |
| 303 | + If the instance is a number, then the instance is valid only if it has a value |
| 304 | + strictly greater than (not equal to) "exclusiveMinimum". |
281 | 305 | </t>
|
282 | 306 | </section>
|
283 | 307 |
|
|
327 | 351 |
|
328 | 352 | <section title="items">
|
329 | 353 | <t>
|
330 |
| - The value of "items" MUST be either a valid JSON Schema or an array of valid JSON Schemas. |
| 354 | + The value of "items" MUST be either a valid JSON Schema or an array of valid |
| 355 | + JSON Schemas. |
331 | 356 | </t>
|
332 | 357 | <t>
|
333 | 358 | This keyword determines how child instances validate for arrays,
|
|
551 | 576 | The value of "propertyNames" MUST be a valid JSON Schema.
|
552 | 577 | </t>
|
553 | 578 | <t>
|
554 |
| - If the instance is an object, this keyword validates if every property name in the instance |
555 |
| - validates against the provided schema. |
| 579 | + If the instance is an object, this keyword validates if every property name in |
| 580 | + the instance validates against the provided schema. |
556 | 581 | Note the property name that the schema is testing will always be a string.
|
557 | 582 | </t>
|
558 | 583 | <t>
|
|
595 | 620 | or "integer" which matches any number with a zero fractional part.
|
596 | 621 | </t>
|
597 | 622 | <t>
|
598 |
| - An instance validates if and only if the instance is in any of the sets listed for this keyword. |
| 623 | + An instance validates if and only if the instance is in any of the sets listed |
| 624 | + for this keyword. |
599 | 625 | </t>
|
600 | 626 | </section>
|
601 | 627 |
|
|
831 | 857 | This attribute applies to string instances.
|
832 | 858 | </t>
|
833 | 859 | <t>
|
834 |
| - A string instance is valid against this attribute if it is a valid URI Reference (either a URI or a relative-reference), |
| 860 | + A string instance is valid against this attribute if it is a valid URI |
| 861 | + Reference (either a URI or a relative-reference), |
835 | 862 | according to <xref target="RFC3986"/>.
|
836 | 863 | </t>
|
837 | 864 | </section>
|
|
860 | 887 |
|
861 | 888 | <section title="Security considerations">
|
862 | 889 | <t>
|
863 |
| - JSON Schema validation defines a vocabulary for JSON Schema core and concerns all the security considerations listed there. |
| 890 | + JSON Schema validation defines a vocabulary for JSON Schema core and concerns all |
| 891 | + the security considerations listed there. |
864 | 892 | </t>
|
865 | 893 | <t>
|
866 |
| - JSON Schema validation allows the use of Regular Expressions, which have numerous different (often incompatible) implementations. |
867 |
| - Some implementations allow the embedding of arbitrary code, which is outside the scope of JSON Schema and MUST NOT be permitted. |
868 |
| - Regular expressions can often also be crafted to be extremely expensive to compute (with so-called "catastrophic backtracking"), |
869 |
| - resulting in a denial-of-service attack. |
| 894 | + JSON Schema validation allows the use of Regular Expressions, which have numerous |
| 895 | + different (often incompatible) implementations. |
| 896 | + Some implementations allow the embedding of arbitrary code, which is outside the |
| 897 | + scope of JSON Schema and MUST NOT be permitted. |
| 898 | + Regular expressions can often also be crafted to be extremely expensive to compute |
| 899 | + (with so-called "catastrophic backtracking"), resulting in a denial-of-service |
| 900 | + attack. |
870 | 901 | </t>
|
871 | 902 | </section>
|
872 | 903 |
|
|
0 commit comments