|
631 | 631 | "valid": true
|
632 | 632 | }
|
633 | 633 | ]
|
| 634 | + }, |
| 635 | + { |
| 636 | + "description": "$dynamicAnchor inside propertyDependencies", |
| 637 | + "schema": { |
| 638 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 639 | + "$id": "http://localhost:1234/draft2020-12/dynamicanchor-in-propertydependencies.json", |
| 640 | + "$defs": { |
| 641 | + "inner": { |
| 642 | + "$id": "inner", |
| 643 | + "$dynamicAnchor": "foo", |
| 644 | + "type": "object", |
| 645 | + "additionalProperties": { |
| 646 | + "$dynamicRef": "#foo" |
| 647 | + } |
| 648 | + } |
| 649 | + }, |
| 650 | + "propertyDependencies": { |
| 651 | + "expectedTypes": { |
| 652 | + "strings": { |
| 653 | + "$id": "east", |
| 654 | + "$dynamicAnchor": "foo", |
| 655 | + "type": "string", |
| 656 | + "$ref": "inner" |
| 657 | + }, |
| 658 | + "integers": { |
| 659 | + "$id": "west", |
| 660 | + "$dynamicAnchor": "foo", |
| 661 | + "type": "integer", |
| 662 | + "$ref": "inner" |
| 663 | + } |
| 664 | + } |
| 665 | + } |
| 666 | + }, |
| 667 | + "tests": [ |
| 668 | + { |
| 669 | + "description": "expected strings - additional property as string is valid", |
| 670 | + "data": { |
| 671 | + "expectedTypes": "strings", |
| 672 | + "anotherProperty": "also a string" |
| 673 | + }, |
| 674 | + "valid": true |
| 675 | + }, |
| 676 | + { |
| 677 | + "description": "expected strings - additional property as not string is invalid", |
| 678 | + "data": { |
| 679 | + "expectedTypes": "strings", |
| 680 | + "anotherProperty": 42 |
| 681 | + }, |
| 682 | + "valid": false |
| 683 | + }, |
| 684 | + { |
| 685 | + "description": "expected integers - additional property as integer is valid", |
| 686 | + "data": { |
| 687 | + "expectedTypes": "integers", |
| 688 | + "anotherProperty": 42 |
| 689 | + }, |
| 690 | + "valid": true |
| 691 | + }, |
| 692 | + { |
| 693 | + "description": "expected integers - additional property as not integer is invalid", |
| 694 | + "data": { |
| 695 | + "expectedTypes": "integers", |
| 696 | + "anotherProperty": "a string" |
| 697 | + }, |
| 698 | + "valid": false |
| 699 | + }, |
| 700 | + { |
| 701 | + "description": "expected missing - additional property as an object is valid", |
| 702 | + "data": { |
| 703 | + "anotherProperty": {} |
| 704 | + }, |
| 705 | + "valid": true |
| 706 | + }, |
| 707 | + { |
| 708 | + "description": "expected missing - additional property as not object is invalid", |
| 709 | + "data": { |
| 710 | + "anotherProperty": 42 |
| 711 | + }, |
| 712 | + "valid": false |
| 713 | + } |
| 714 | + ] |
634 | 715 | }
|
635 | 716 | ]
|
0 commit comments