|
177 | 177 | }, |
178 | 178 | { |
179 | 179 | "description": "remote ref, containing refs itself", |
180 | | - "schema": {"$ref": "https://json-schema.org/draft/2019-09/schema"}, |
| 180 | + "schema": { |
| 181 | + "$ref": "https://json-schema.org/draft/2019-09/schema" |
| 182 | + }, |
181 | 183 | "tests": [ |
182 | 184 | { |
183 | 185 | "description": "remote ref valid", |
|
298 | 300 | "tests": [ |
299 | 301 | { |
300 | 302 | "description": "valid tree", |
301 | | - "data": { |
| 303 | + "data": { |
302 | 304 | "meta": "root", |
303 | 305 | "nodes": [ |
304 | 306 | { |
|
327 | 329 | }, |
328 | 330 | { |
329 | 331 | "description": "invalid tree", |
330 | | - "data": { |
| 332 | + "data": { |
331 | 333 | "meta": "root", |
332 | 334 | "nodes": [ |
333 | 335 | { |
|
575 | 577 | "valid": false |
576 | 578 | } |
577 | 579 | ] |
| 580 | + }, |
| 581 | + { |
| 582 | + "description": "order of evaluation: $id and $ref", |
| 583 | + "schema": { |
| 584 | + "$comment": "$id must be evaluated before $ref to get the proper $ref destination", |
| 585 | + "$id": "/ref-and-id1/base.json", |
| 586 | + "$ref": "int.json", |
| 587 | + "$defs": { |
| 588 | + "bigint": { |
| 589 | + "$comment": "canonical uri: /ref-and-id1/int.json", |
| 590 | + "$id": "int.json", |
| 591 | + "maximum": 10 |
| 592 | + }, |
| 593 | + "smallint": { |
| 594 | + "$comment": "canonical uri: /ref-and-id1-int.json", |
| 595 | + "$id": "/ref-and-id1-int.json", |
| 596 | + "maximum": 2 |
| 597 | + } |
| 598 | + } |
| 599 | + }, |
| 600 | + "tests": [ |
| 601 | + { |
| 602 | + "description": "data is valid against first definition", |
| 603 | + "data": 5, |
| 604 | + "valid": true |
| 605 | + }, |
| 606 | + { |
| 607 | + "description": "data is invalid against first definition", |
| 608 | + "data": 50, |
| 609 | + "valid": false |
| 610 | + } |
| 611 | + ] |
| 612 | + }, |
| 613 | + { |
| 614 | + "description": "order of evaluation: $id and $anchor and $ref", |
| 615 | + "schema": { |
| 616 | + "$comment": "$id must be evaluated before $ref to get the proper $ref destination", |
| 617 | + "$id": "/ref-and-id2/base.json", |
| 618 | + "$ref": "#bigint", |
| 619 | + "$defs": { |
| 620 | + "bigint": { |
| 621 | + "$comment": "canonical uri: /ref-and-id2/base.json/$defs/bigint; another valid uri for this location: /ref-and-id2/base.json#bigint", |
| 622 | + "$anchor": "bigint", |
| 623 | + "maximum": 10 |
| 624 | + }, |
| 625 | + "smallint": { |
| 626 | + "$comment": "canonical uri: /ref-and-id2#/$defs/smallint; another valid uri for this location: /ref-and-id2/#bigint", |
| 627 | + "$id": "/ref-and-id2/", |
| 628 | + "$anchor": "bigint", |
| 629 | + "maximum": 2 |
| 630 | + } |
| 631 | + } |
| 632 | + }, |
| 633 | + "tests": [ |
| 634 | + { |
| 635 | + "description": "data is valid against first definition", |
| 636 | + "data": 5, |
| 637 | + "valid": true |
| 638 | + }, |
| 639 | + { |
| 640 | + "description": "data is invalid against first definition", |
| 641 | + "data": 50, |
| 642 | + "valid": false |
| 643 | + } |
| 644 | + ] |
578 | 645 | } |
579 | 646 | ] |
0 commit comments