|
170 | 170 |
|
171 | 171 | <section title="Validation of primitive types and child values">
|
172 | 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. |
| 173 | + Two of the primitive types, array and object, allow for child values. |
| 174 | + The JSON Schema core specification defines keywords that determine |
| 175 | + which subschemas are applied to each child value. |
175 | 176 | </t>
|
176 | 177 | <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. |
| 178 | + Validation of arrays and objects succeed if, in addition to validating |
| 179 | + against any relevant validation keywords, each child instance |
| 180 | + successfully validates against all subschemas that apply to it. |
182 | 181 | </t>
|
183 | 182 | </section>
|
184 | 183 |
|
|
310 | 309 | </t>
|
311 | 310 | </section>
|
312 | 311 |
|
313 |
| - <section title="items"> |
314 |
| - <t> |
315 |
| - The value of "items" MUST be either an object or an array of objects. |
316 |
| - Each object MUST be a valid JSON Schema. |
317 |
| - </t> |
318 |
| - <t> |
319 |
| - If absent, it can be considered present with an empty schema. |
320 |
| - </t> |
321 |
| - <t> |
322 |
| - This keyword controls child instance validation. Validation of the |
323 |
| - primitive instance type against this keyword always succeeds. |
324 |
| - </t> |
325 |
| - <t> |
326 |
| - If "items" is a schema, child validation succeeds if all elements |
327 |
| - in the array successfully validate against that schema. |
328 |
| - </t> |
329 |
| - <t> |
330 |
| - If "items" is an array of schemas, child validation succeeds if |
331 |
| - each element of the instance validates against the schema at the |
332 |
| - same position, if any. |
333 |
| - </t> |
334 |
| - </section> |
335 |
| - |
336 |
| - <section title="additionalItems"> |
337 |
| - <t> |
338 |
| - The value of "additionalItems" MUST be a boolean or an object. |
339 |
| - If it is an object, the object MUST be a valid JSON Schema. |
340 |
| - </t> |
341 |
| - <t> |
342 |
| - If absent, it can be considered present with an empty schema. |
343 |
| - </t> |
344 |
| - <t> |
345 |
| - This keyword controls child instance validation. Validation of the |
346 |
| - primitive instance type against this keyword always succeeds. |
347 |
| - </t> |
348 |
| - <t> |
349 |
| - If "items" is an array of schemas, child validation succeeds |
350 |
| - if every instance element at a position greater than the size |
351 |
| - of "items" validates against "additionalItems". |
352 |
| - </t> |
353 |
| - <t> |
354 |
| - Otherwise, "additionalItems" MUST be ignored, as the "items" |
355 |
| - schema (possibly the default value of an empty schema) is |
356 |
| - applied to all elements. |
357 |
| - </t> |
358 |
| - </section> |
359 |
| - |
360 | 312 | <section title="maxItems">
|
361 | 313 | <t>
|
362 | 314 | The value of this keyword MUST be an integer. This integer MUST be
|
|
448 | 400 | </t>
|
449 | 401 | </section>
|
450 | 402 |
|
451 |
| - <section title="properties"> |
452 |
| - <t> |
453 |
| - The value of "properties" MUST be an object. Each value of this object |
454 |
| - MUST be an object, and each object MUST be a valid JSON Schema. |
455 |
| - </t> |
456 |
| - <t> |
457 |
| - If absent, it can be considered the same as an empty object. |
458 |
| - </t> |
459 |
| - <t> |
460 |
| - This keyword controls child instance validation. Validation of the |
461 |
| - primitive instance type against this keyword always succeeds. |
462 |
| - </t> |
463 |
| - <t> |
464 |
| - Child validation succeeds if, for each name that appears in both |
465 |
| - the instance and as a name within this keyword's value, the instance |
466 |
| - value successfully validates against the corresponding schema. |
467 |
| - </t> |
468 |
| - </section> |
469 |
| - |
470 |
| - <section title="patternProperties"> |
471 |
| - <t> |
472 |
| - The value of "patternProperties" MUST be an object. Each property name |
473 |
| - of this object SHOULD be a valid regular expression, according to the |
474 |
| - ECMA 262 regular expression dialect. Each property value of this object |
475 |
| - MUST be an object, and each object MUST be a valid JSON Schema. |
476 |
| - </t> |
477 |
| - <t> |
478 |
| - If absent, it can be considered the same as an empty object. |
479 |
| - </t> |
480 |
| - <t> |
481 |
| - This keyword controls child instance validation. Validation of the |
482 |
| - primitive instance type against this keyword always succeeds. |
483 |
| - </t> |
484 |
| - <t> |
485 |
| - Child validation succeeds if, for each instance name that matches any |
486 |
| - regular expressions that appear as a property name in this keyword's value, |
487 |
| - the child instance for that name successfully validates against each |
488 |
| - schema that corresponds to a matching regular expression. |
489 |
| - </t> |
490 |
| - </section> |
491 |
| - |
492 |
| - <section title="additionalProperties"> |
493 |
| - <t> |
494 |
| - The value of "additionalProperties" MUST be a boolean or an |
495 |
| - object. If it is an object, the object MUST be a valid JSON Schema. |
496 |
| - </t> |
497 |
| - <t> |
498 |
| - If "additionalProperties" is absent, it may be considered present with |
499 |
| - an empty schema as a value. |
500 |
| - </t> |
501 |
| - <t> |
502 |
| - This keyword controls child instance validation. Validation of the |
503 |
| - primitive instance type against this keyword always succeeds. |
504 |
| - </t> |
505 |
| - <t> |
506 |
| - Child validation with "additionalProperties" applies only to the child |
507 |
| - values of instance names that do not match any names in "properties", |
508 |
| - and do not match any regular expression in "patternProperties". |
509 |
| - </t> |
510 |
| - <t> |
511 |
| - For all such properties, child validation succeeds if the child instance |
512 |
| - validates against the "additionalProperties" schema. |
513 |
| - </t> |
514 |
| - </section> |
515 |
| - |
516 | 403 | <section title="dependencies">
|
517 | 404 | <t>
|
518 | 405 | This keyword specifies rules that are evaluated if the instance is an object and
|
|
0 commit comments