|
168 | 168 | </t>
|
169 | 169 | </section>
|
170 | 170 |
|
| 171 | + <section title="Validation of primitive types and child values"> |
| 172 | + <t> |
| 173 | + Two of the primitive types, array and object, allow for child values. The validation of |
| 174 | + the primitive type is considered separately from the validation of child instances. |
| 175 | + </t> |
| 176 | + <t> |
| 177 | + For arrays, primitive type validation consists of validating restrictions on length. |
| 178 | + </t> |
| 179 | + <t> |
| 180 | + For objects, primitive type validation consists of validating restrictions on the presence |
| 181 | + or absence of property names. |
| 182 | + </t> |
| 183 | + </section> |
| 184 | + |
171 | 185 | <section title="Missing keywords">
|
172 | 186 | <t>
|
173 | 187 | Validation keywords that are missing never restrict validation.
|
|
297 | 311 | </t>
|
298 | 312 | </section>
|
299 | 313 |
|
300 |
| - <section title="additionalItems and items"> |
| 314 | + <section title="items"> |
301 | 315 | <t>
|
302 |
| - The value of "additionalItems" MUST be either a boolean or an object. If |
303 |
| - it is an object, this object MUST be a valid JSON Schema. |
| 316 | + The value of "items" MUST be either an object or an array of objects. |
| 317 | + Each object MUST be a valid JSON Schema. |
304 | 318 | </t>
|
305 | 319 | <t>
|
306 |
| - The value of "items" MUST be either a schema or array of schemas. |
| 320 | + If absent, it can be considered present with an empty schema. |
307 | 321 | </t>
|
308 | 322 | <t>
|
309 |
| - Successful validation of an array instance with regards to these two |
310 |
| - keywords is determined as follows: |
| 323 | + This keyword controls child instance validation. Validation of the |
| 324 | + primitive instance type against this keyword always succeeds. |
| 325 | + </t> |
| 326 | + <t> |
| 327 | + If "items" is a schema, child validation succeeds if all elements |
| 328 | + in the array successfully validate against that schema. |
| 329 | + </t> |
| 330 | + <t> |
| 331 | + If "items" is an array of schemas, child validation succeeds if |
| 332 | + each element of the instance validates against the schema at the |
| 333 | + same position, if any. |
| 334 | + </t> |
| 335 | + </section> |
311 | 336 |
|
312 |
| - <list> |
313 |
| - <t>if "items" is not present, or its value is an object, validation |
314 |
| - of the instance always succeeds, regardless of the value of |
315 |
| - "additionalItems";</t> |
316 |
| - <t>if the value of "additionalItems" is boolean value true or an |
317 |
| - object, validation of the instance always succeeds;</t> |
318 |
| - <t>if the value of "additionalItems" is boolean value false and the |
319 |
| - value of "items" is an array, the instance is valid if |
320 |
| - its size is less than, or equal to, the size of "items".</t> |
321 |
| - </list> |
| 337 | + <section title="additionalItems"> |
| 338 | + <t> |
| 339 | + The value of "additionalItems" MUST be a boolean or an object. |
| 340 | + If it is an object, the object MUST be a valid JSON Schema. |
| 341 | + </t> |
| 342 | + <t> |
| 343 | + If absent, it can be considered present with an empty schema. |
322 | 344 | </t>
|
323 | 345 | <t>
|
324 |
| - If either keyword is absent, it may be considered present with an empty |
325 |
| - schema. |
| 346 | + This keyword controls child instance validation. Validation of the |
| 347 | + primitive instance type against this keyword always succeeds. |
| 348 | + </t> |
| 349 | + <t> |
| 350 | + If "items" is an array of schemas, child validation succeeds |
| 351 | + if every instance element at a position greater than the size |
| 352 | + of "items" validates against "additionalItems". |
326 | 353 | </t>
|
327 | 354 | </section>
|
328 | 355 |
|
|
415 | 442 | <t>
|
416 | 443 | If absent, it can be considered the same as an empty object.
|
417 | 444 | </t>
|
| 445 | + <t> |
| 446 | + This keyword controls child instance validation. Validation of the |
| 447 | + primitive instance type against this keyword always succeeds. |
| 448 | + </t> |
| 449 | + <t> |
| 450 | + Child validation succeeds if, for each name that appears in both |
| 451 | + the instance and as a name within this keyword's value, the instance |
| 452 | + value successfully validates against the corresponding schema. |
| 453 | + </t> |
418 | 454 | </section>
|
419 | 455 |
|
420 | 456 | <section title="patternProperties">
|
|
427 | 463 | <t>
|
428 | 464 | If absent, it can be considered the same as an empty object.
|
429 | 465 | </t>
|
| 466 | + <t> |
| 467 | + This keyword controls child instance validation. Validation of the |
| 468 | + primitive instance type against this keyword always succeeds. |
| 469 | + </t> |
| 470 | + <t> |
| 471 | + Child validation succeeds if, for each instance name that matches any |
| 472 | + regular expressions that appear as a property name in this keyword's value, |
| 473 | + the child instance for that name successfully validates against each |
| 474 | + schema that corresponds to a matching regular expression. |
| 475 | + </t> |
430 | 476 | </section>
|
431 | 477 |
|
432 | 478 | <section title="additionalProperties">
|
433 | 479 | <t>
|
434 |
| - The value of "additionalProperties" MUST be a boolean or a schema. |
| 480 | + The value of "additionalProperties" MUST be a boolean or an |
| 481 | + object. If it is an object, the object MUST be a valid JSON Schema. |
435 | 482 | </t>
|
436 | 483 | <t>
|
437 | 484 | If "additionalProperties" is absent, it may be considered present with
|
438 | 485 | an empty schema as a value.
|
439 | 486 | </t>
|
440 | 487 | <t>
|
441 |
| - If "additionalProperties" is true, validation always succeeds. |
| 488 | + This keyword controls child instance validation. Validation of the |
| 489 | + primitive instance type against this keyword always succeeds. |
442 | 490 | </t>
|
443 | 491 | <t>
|
444 |
| - If "additionalProperties" is false, validation succeeds only if the instance |
445 |
| - is an object and all properties on the instance were covered by "properties" |
446 |
| - and/or "patternProperties". |
| 492 | + Child validation with "additionalProperties" applies only to the child |
| 493 | + values of instance names that do not match any names in "properties", |
| 494 | + and do not match any regular expression in "patternProperties". |
447 | 495 | </t>
|
448 | 496 | <t>
|
449 |
| - If "additionalProperties" is an object, validate the value as a schema to all |
450 |
| - of the properties that weren't validated by "properties" nor "patternProperties". |
| 497 | + For all such properties, child validation succeeds if the child instance |
| 498 | + validates agains the "additionalProperties" schema. |
451 | 499 | </t>
|
452 | 500 | </section>
|
453 | 501 |
|
|
0 commit comments