|
98 | 98 | object instances. It uses the term "children instances" to refer to array elements
|
99 | 99 | or object member values.
|
100 | 100 | </t>
|
101 |
| - <t> |
102 |
| - This specification uses the term "property set" to refer to the set of an object's |
103 |
| - member names; for instance, the property set of JSON Object { "a": 1, "b": 2 } is |
104 |
| - [ "a", "b" ]. |
105 |
| - </t> |
106 | 101 | <t>
|
107 | 102 | Elements in an array value are said to be unique if no two elements of this array
|
108 | 103 | are <xref target="json-schema">equal</xref>.
|
|
167 | 162 |
|
168 | 163 | <section title="Keywords and instance primitive types">
|
169 | 164 | <t>
|
170 |
| - Most validation keywords only limit the range of values within a certain primitive type. |
171 |
| - When the primitive type of the instance is not of the type targeted by the keyword, the |
| 165 | + Most validation keywords only constrain values within a certain primitive type. |
| 166 | + When the type of the instance is not of the type targeted by the keyword, the |
172 | 167 | validation succeeds.
|
173 | 168 | </t>
|
174 | 169 | <t>
|
|
222 | 217 | <t>
|
223 | 218 | For schema author convenience, there are some exceptions:
|
224 | 219 | <list>
|
225 |
| - <t>"additionalProperties", whose behavior is defined in terms of "properties" and "patternProperties";</t> |
226 |
| - <t>"additionalItems", whose behavior is defined in terms of "items"; and</t> |
| 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> |
227 | 222 | </list>
|
228 | 223 | </t>
|
229 | 224 | </section>
|
|
241 | 236 |
|
242 | 237 | <section title="Validation keywords">
|
243 | 238 | <t>
|
244 |
| - Validation keywords in a schema impose requirements for successfully validating an instance. |
| 239 | + Validation keywords in a schema impose requirements for successful validation of an instance. |
245 | 240 | </t>
|
246 | 241 |
|
247 | 242 | <section title="multipleOf">
|
|
290 | 285 | </section>
|
291 | 286 |
|
292 | 287 | <section title="maxLength">
|
293 |
| - <t>The value of this keyword MUST be a non-negative integer.</t> |
294 | 288 | <t>
|
295 |
| - The value of this keyword MUST be an integer. This integer MUST be |
296 |
| - greater than, or equal to, 0. |
297 |
| - </t> |
| 289 | + The value of this keyword MUST be a non-negative integer.</t> |
298 | 290 | <t>
|
299 | 291 | A string instance is valid against this keyword if its
|
300 | 292 | length is less than, or equal to, the value of this keyword.
|
|
306 | 298 | </section>
|
307 | 299 |
|
308 | 300 | <section title="minLength">
|
| 301 | + <t> |
| 302 | + The value of this keyword MUST be a non-negative integer. |
| 303 | + </t> |
309 | 304 | <t>
|
310 | 305 | A string instance is valid against this keyword if its
|
311 | 306 | length is greater than, or equal to, the value of this keyword.
|
|
316 | 311 | characters as defined by <xref target="RFC7159">RFC 7159</xref>.
|
317 | 312 | </t>
|
318 | 313 | <t>
|
319 |
| - The value of this keyword MUST be an integer. This integer MUST be |
320 |
| - greater than, or equal to, 0. |
321 |
| - </t> |
322 |
| - <t> |
323 |
| - "minLength", if absent, may be considered as being present with integer |
324 |
| - value 0. |
| 314 | + Omitting this keyword has the same behavior as a value of 0. |
325 | 315 | </t>
|
326 | 316 | </section>
|
327 | 317 |
|
|
342 | 332 | <t>
|
343 | 333 | The value of "items" MUST be either a valid JSON Schema or an array of valid JSON Schemas.
|
344 | 334 | </t>
|
345 |
| - <t> |
346 |
| - If absent, it can be considered present with an empty schema. |
347 |
| - </t> |
348 | 335 | <t>
|
349 | 336 | This keyword determines how child instances validate for arrays,
|
350 | 337 | and does not directly validate the immediate instance itself.
|
|
358 | 345 | each element of the instance validates against the schema at the
|
359 | 346 | same position, if any.
|
360 | 347 | </t>
|
| 348 | + <t> |
| 349 | + Omitting this keyword has the same behavior as an empty schema. |
| 350 | + </t> |
361 | 351 | </section>
|
362 | 352 |
|
363 | 353 | <section title="additionalItems">
|
364 | 354 | <t>
|
365 | 355 | The value of "additionalItems" MUST be a valid JSON Schema.
|
366 | 356 | </t>
|
367 |
| - <t> |
368 |
| - If absent, it can be considered present with an empty schema. |
369 |
| - </t> |
370 | 357 | <t>
|
371 | 358 | This keyword determines how child instances validate for arrays,
|
372 | 359 | and does not directly validate the immediate instance itself.
|
|
381 | 368 | schema (possibly the default value of an empty schema) is
|
382 | 369 | applied to all elements.
|
383 | 370 | </t>
|
| 371 | + <t> |
| 372 | + Omitting this keyword has the same behavior as an empty schema. |
| 373 | + </t> |
384 | 374 | </section>
|
385 | 375 |
|
386 | 376 | <section title="maxItems">
|
387 | 377 | <t>
|
388 |
| - The value of this keyword MUST be an integer. This integer MUST be |
389 |
| - greater than, or equal to, 0. |
| 378 | + The value of this keyword MUST be a non-negative integer. |
390 | 379 | </t>
|
391 | 380 | <t>
|
392 | 381 | An array instance is valid against "maxItems" if its size is
|
|
396 | 385 |
|
397 | 386 | <section title="minItems">
|
398 | 387 | <t>
|
399 |
| - The value of this keyword MUST be an integer. This integer MUST be |
400 |
| - greater than, or equal to, 0. |
| 388 | + The value of this keyword MUST be a non-negative integer. |
401 | 389 | </t>
|
402 | 390 | <t>
|
403 | 391 | An array instance is valid against "minItems" if its size is
|
404 | 392 | greater than, or equal to, the value of this keyword.
|
405 | 393 | </t>
|
406 | 394 | <t>
|
407 |
| - If this keyword is not present, it may be considered present with a |
408 |
| - value of 0. |
| 395 | + Omitting this keyword has the same behavior as a value of 0. |
409 | 396 | </t>
|
410 | 397 | </section>
|
411 | 398 |
|
|
419 | 406 | successfully if all of its elements are unique.
|
420 | 407 | </t>
|
421 | 408 | <t>
|
422 |
| - If not present, this keyword may be considered present with boolean |
423 |
| - value false. |
| 409 | + Omitting this keyword has the same behavior as a value of false. |
424 | 410 | </t>
|
425 | 411 | </section>
|
426 | 412 |
|
|
437 | 423 |
|
438 | 424 | <section title="maxProperties">
|
439 | 425 | <t>
|
440 |
| - The value of this keyword MUST be an integer. This integer MUST be |
441 |
| - greater than, or equal to, 0. |
| 426 | + The value of this keyword MUST be a non-negative integer. |
442 | 427 | </t>
|
443 | 428 | <t>
|
444 | 429 | An object instance is valid against "maxProperties" if its
|
|
449 | 434 |
|
450 | 435 | <section title="minProperties">
|
451 | 436 | <t>
|
452 |
| - The value of this keyword MUST be an integer. This integer MUST be |
453 |
| - greater than, or equal to, 0. |
| 437 | + The value of this keyword MUST be a non-negative integer. |
454 | 438 | </t>
|
455 | 439 | <t>
|
456 | 440 | An object instance is valid against "minProperties" if its
|
457 | 441 | number of properties is greater than, or equal to, the value of this
|
458 | 442 | keyword.
|
459 | 443 | </t>
|
460 | 444 | <t>
|
461 |
| - If this keyword is not present, it may be considered present with a |
462 |
| - value of 0. |
| 445 | + Omitting this keyword has the same behavior as a value of 0. |
463 | 446 | </t>
|
464 | 447 | </section>
|
465 | 448 |
|
466 | 449 | <section title="required">
|
467 | 450 | <t>
|
468 |
| - The value of this keyword MUST be an array. Elements of this array, |
469 |
| - if any, MUST be strings, and MUST be unique. |
| 451 | + The value of this keyword MUST be an array. |
| 452 | + Elements of this array, if any, MUST be strings, and MUST be unique. |
470 | 453 | </t>
|
471 | 454 | <t>
|
472 |
| - An object instance is valid against this keyword if its |
473 |
| - property set contains all elements in this keyword's array value. |
| 455 | + An object instance is valid against this keyword if every item in the array is |
| 456 | + the name of a property in the instance. |
474 | 457 | </t>
|
475 | 458 | <t>
|
476 |
| - If this keyword is not present, it may be considered present |
477 |
| - as an empty array. |
| 459 | + Omitting this keyword has the same behavior as an empty array. |
478 | 460 | </t>
|
479 | 461 | </section>
|
480 | 462 |
|
481 | 463 | <section title="properties">
|
482 | 464 | <t>
|
483 |
| - The value of "properties" MUST be an object. Each value of this object |
484 |
| - MUST be a valid JSON Schema. |
485 |
| - </t> |
486 |
| - <t> |
487 |
| - If absent, it can be considered the same as an empty schema. |
| 465 | + The value of "properties" MUST be an object. |
| 466 | + Each value of this object MUST be a valid JSON Schema. |
488 | 467 | </t>
|
489 | 468 | <t>
|
490 | 469 | This keyword determines how child instances validate for objects,
|
|
496 | 475 | instance for that name successfully validates against the
|
497 | 476 | corresponding schema.
|
498 | 477 | </t>
|
| 478 | + <t> |
| 479 | + Omitting this keyword has the same behavior as an empty object. |
| 480 | + </t> |
499 | 481 | </section>
|
500 | 482 |
|
501 | 483 | <section title="patternProperties">
|
|
505 | 487 | ECMA 262 regular expression dialect. Each property value of this object
|
506 | 488 | MUST be a valid JSON Schema.
|
507 | 489 | </t>
|
508 |
| - <t> |
509 |
| - If absent, it can be considered the same as an empty schema. |
510 |
| - </t> |
511 | 490 | <t>
|
512 | 491 | This keyword determines how child instances validate for objects,
|
513 | 492 | and does not directly validate the immediate instance itself.
|
|
520 | 499 | the child instance for that name successfully validates against each
|
521 | 500 | schema that corresponds to a matching regular expression.
|
522 | 501 | </t>
|
| 502 | + <t> |
| 503 | + Omitting this keyword has the same behavior as an empty object. |
| 504 | + </t> |
523 | 505 | </section>
|
524 | 506 |
|
525 | 507 | <section title="additionalProperties">
|
526 | 508 | <t>
|
527 | 509 | The value of "additionalProperties" MUST be a valid JSON Schema.
|
528 | 510 | </t>
|
529 |
| - <t> |
530 |
| - If "additionalProperties" is absent, it may be considered present with |
531 |
| - an empty schema as a value. |
532 |
| - </t> |
533 | 511 | <t>
|
534 | 512 | This keyword determines how child instances validate for objects,
|
535 | 513 | and does not directly validate the immediate instance itself.
|
|
543 | 521 | For all such properties, child validation succeeds if the child instance
|
544 | 522 | validates against the "additionalProperties" schema.
|
545 | 523 | </t>
|
| 524 | + <t> |
| 525 | + Omitting this keyword has the same behavior as an empty schema. |
| 526 | + </t> |
546 | 527 | </section>
|
547 | 528 |
|
548 | 529 | <section title="dependencies">
|
|
564 | 545 | a property in the instance, each of the items in the dependency
|
565 | 546 | value must be a property that exists in the instance.
|
566 | 547 | </t>
|
| 548 | + <t> |
| 549 | + Omitting this keyword has the same behavior as an empty object. |
| 550 | + </t> |
567 | 551 | </section>
|
568 | 552 |
|
569 | 553 | <section title="propertyNames">
|
|
575 | 559 | validates against the provided schema.
|
576 | 560 | Note the property name that the schema is testing will always be a string.
|
577 | 561 | </t>
|
| 562 | + <t> |
| 563 | + Omitting this keyword has the same behavior as an empty schema. |
| 564 | + </t> |
578 | 565 | </section>
|
579 | 566 |
|
580 | 567 | <section title="enum">
|
581 | 568 | <t>
|
582 | 569 | The value of this keyword MUST be an array. This array SHOULD have at
|
583 | 570 | least one element. Elements in the array SHOULD be unique.
|
584 | 571 | </t>
|
585 |
| - |
586 |
| - <t> |
587 |
| - Elements in the array MAY be of any type, including null. |
588 |
| - </t> |
589 | 572 | <t>
|
590 | 573 | An instance validates successfully against this keyword if its value is
|
591 | 574 | equal to one of the elements in this keyword's array value.
|
592 | 575 | </t>
|
| 576 | + <t> |
| 577 | + Elements in the array might be of any value, including null. |
| 578 | + </t> |
593 | 579 | </section>
|
594 | 580 |
|
595 | 581 | <section title="const">
|
|
619 | 605 |
|
620 | 606 | <section title="allOf">
|
621 | 607 | <t>
|
622 |
| - This keyword's value MUST be an array. This array MUST have at least one |
623 |
| - element. |
624 |
| - </t> |
625 |
| - <t> |
626 |
| - Elements of the array MUST be objects. Each object MUST be a valid JSON |
627 |
| - Schema. |
| 608 | + This keyword's value MUST be a non-empty array. |
| 609 | + Each item of the array MUST be a valid JSON Schema. |
628 | 610 | </t>
|
629 | 611 | <t>
|
630 | 612 | An instance validates successfully against this keyword if it validates
|
|
634 | 616 |
|
635 | 617 | <section title="anyOf">
|
636 | 618 | <t>
|
637 |
| - This keyword's value MUST be an array. This array MUST have at least one |
638 |
| - element. |
639 |
| - </t> |
640 |
| - <t> |
641 |
| - Elements of the array MUST be objects. Each object MUST be a valid JSON |
642 |
| - Schema. |
| 619 | + This keyword's value MUST be a non-empty array. |
| 620 | + Each item of the array MUST be a valid JSON Schema. |
643 | 621 | </t>
|
644 | 622 | <t>
|
645 | 623 | An instance validates successfully against this keyword if it validates
|
|
649 | 627 |
|
650 | 628 | <section title="oneOf">
|
651 | 629 | <t>
|
652 |
| - This keyword's value MUST be an array. This array MUST have at least one |
653 |
| - element. |
654 |
| - </t> |
655 |
| - <t> |
656 |
| - Elements of the array MUST be objects. Each object MUST be a valid JSON |
657 |
| - Schema. |
| 630 | + This keyword's value MUST be a non-empty array. |
| 631 | + Each item of the array MUST be a valid JSON Schema. |
658 | 632 | </t>
|
659 | 633 | <t>
|
660 | 634 | An instance validates successfully against this keyword if it validates
|
|
664 | 638 |
|
665 | 639 | <section title="not">
|
666 | 640 | <t>
|
667 |
| - This keyword's value MUST be an object. This object MUST be a valid JSON |
668 |
| - Schema. |
| 641 | + This keyword's value MUST be a valid JSON Schema. |
669 | 642 | </t>
|
670 | 643 | <t>
|
671 | 644 | An instance is valid against this keyword if it fails to validate
|
672 | 645 | successfully against the schema defined by this keyword.
|
673 | 646 | </t>
|
674 | 647 | </section>
|
| 648 | + </section> |
675 | 649 |
|
| 650 | + <section title="Metadata keywords"> |
676 | 651 | <section title="definitions">
|
677 | 652 | <t>
|
678 |
| - This keyword's value MUST be an object. Each member value of this object |
679 |
| - MUST be a valid JSON Schema. |
| 653 | + This keyword's value MUST be an object. |
| 654 | + Each member value of this object MUST be a valid JSON Schema. |
680 | 655 | </t>
|
681 | 656 | <t>
|
682 | 657 | This keyword plays no role in validation per se. Its role is to provide
|
|
707 | 682 | </figure>
|
708 | 683 | </t>
|
709 | 684 | </section>
|
710 |
| - </section> |
711 |
| - |
712 |
| - <section title="Metadata keywords"> |
713 | 685 |
|
714 | 686 | <section title='"title" and "description"'>
|
715 | 687 | <t>
|
|
0 commit comments