|
484 | 484 | "valid": true
|
485 | 485 | }
|
486 | 486 | ]
|
| 487 | + }, |
| 488 | + { |
| 489 | + "description": "$dynamicAnchor inside propertyDependencies", |
| 490 | + "schema": { |
| 491 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 492 | + "$id": "http://localhost:1234/draft2020-12/dynamicanchor-in-propertydependencies.json", |
| 493 | + "$defs": { |
| 494 | + "inner": { |
| 495 | + "$id": "inner", |
| 496 | + "$dynamicAnchor": "foo", |
| 497 | + "type": "object", |
| 498 | + "additionalProperties": { |
| 499 | + "$dynamicRef": "#foo" |
| 500 | + } |
| 501 | + } |
| 502 | + }, |
| 503 | + "propertyDependencies": { |
| 504 | + "expectedTypes": { |
| 505 | + "strings": { |
| 506 | + "$id": "east", |
| 507 | + "$ref": "inner", |
| 508 | + "$defs": { |
| 509 | + "foo": { |
| 510 | + "$dynamicAnchor": "foo", |
| 511 | + "type": "string" |
| 512 | + } |
| 513 | + } |
| 514 | + }, |
| 515 | + "integers": { |
| 516 | + "$id": "west", |
| 517 | + "$ref": "inner", |
| 518 | + "$defs": { |
| 519 | + "foo": { |
| 520 | + "$dynamicAnchor": "foo", |
| 521 | + "type": "integer" |
| 522 | + } |
| 523 | + } |
| 524 | + } |
| 525 | + } |
| 526 | + } |
| 527 | + }, |
| 528 | + "tests": [ |
| 529 | + { |
| 530 | + "description": "expected strings - additional property as string is valid", |
| 531 | + "data": { |
| 532 | + "expectedTypes": "strings", |
| 533 | + "anotherProperty": "also a string" |
| 534 | + }, |
| 535 | + "valid": true |
| 536 | + }, |
| 537 | + { |
| 538 | + "description": "expected strings - additional property as not string is invalid", |
| 539 | + "data": { |
| 540 | + "expectedTypes": "strings", |
| 541 | + "anotherProperty": 42 |
| 542 | + }, |
| 543 | + "valid": false |
| 544 | + }, |
| 545 | + { |
| 546 | + "description": "expected integers - additional property as integer is valid", |
| 547 | + "data": { |
| 548 | + "expectedTypes": "integers", |
| 549 | + "anotherProperty": 42 |
| 550 | + }, |
| 551 | + "valid": true |
| 552 | + }, |
| 553 | + { |
| 554 | + "description": "expected integers - additional property as not integer is invalid", |
| 555 | + "data": { |
| 556 | + "expectedTypes": "integers", |
| 557 | + "anotherProperty": "a string" |
| 558 | + }, |
| 559 | + "valid": false |
| 560 | + }, |
| 561 | + { |
| 562 | + "description": "expected missing - additional property as an object is valid", |
| 563 | + "data": { |
| 564 | + "anotherProperty": {} |
| 565 | + }, |
| 566 | + "valid": true |
| 567 | + }, |
| 568 | + { |
| 569 | + "description": "expected missing - additional property as not object is invalid", |
| 570 | + "data": { |
| 571 | + "anotherProperty": 42 |
| 572 | + }, |
| 573 | + "valid": false |
| 574 | + } |
| 575 | + ] |
487 | 576 | }
|
488 | 577 | ]
|
0 commit comments