Debian Codegraph @

t/additional-tests-draft2019-09/ref-and-id.json

raw
1 [
2 {
3 "description": "$id must be evaluated before $ref to get the proper $ref destination (with $anchors)",
4 "schema": {
5 "$id": "/ref-and-id1/base.json",
6 "$ref": "#bigint",
7 "$defs": {
8 "bigint": {
9 "$comment": "canonical uri: /ref-and-id1/base.json/$defs/bigint; another valid uri for this location: /ref-and-id1/base.json#bigint",
10 "$anchor": "bigint",
11 "maximum": 10
12 },
13 "smallint": {
14 "$comment": "canonical uri: /ref-and-id1#/$defs/smallint; another valid uri for this location: /ref-and-id1/#bigint",
15 "$id": "/ref-and-id1/",
16 "$anchor": "bigint",
17 "maximum": 2
18 }
19 }
20 },
21 "tests": [
22 {
23 "description": "data is valid against first definition",
24 "data": 5,
25 "valid": true
26 },
27 {
28 "description": "data is invalid against first definition",
29 "data": 50,
30 "valid": false
31 }
32 ]
33 },
34 {
35 "description": "$id must be evaluated before $ref to get the proper $ref destination (with uris)",
36 "schema": {
37 "$id": "/ref-and-id2/base.json",
38 "$ref": "int.json",
39 "$defs": {
40 "bigint": {
41 "$comment": "canonical uri: /ref-and-id2/int.json",
42 "$id": "int.json",
43 "maximum": 10
44 },
45 "smallint": {
46 "$comment": "canonical uri: /ref-and-id2-int.json",
47 "$id": "/ref-and-id2-int.json",
48 "maximum": 2
49 }
50 }
51 },
52 "tests": [
53 {
54 "description": "data is valid against first definition",
55 "data": 5,
56 "valid": true
57 },
58 {
59 "description": "data is invalid against first definition",
60 "data": 50,
61 "valid": false
62 }
63 ]
64 },
65 {
66 "description": "$id must be evaluated before $ref to get the proper $ref destination (with json pointers)",
67 "schema": {
68 "$id": "https://localhost:1234/base/",
69 "allOf": [
70 {
71 "$id": "allOf0/",
72 "$ref": "#/oneOf/0",
73 "oneOf": [
74 { "type": "number" }
75 ]
76 }
77 ],
78 "oneOf": [
79 { "type": "string" },
80 { "type": "number" }
81 ]
82 },
83 "tests": [
84 {
85 "description": "data is valid against innermost type check",
86 "data": 1,
87 "valid": true
88 },
89 {
90 "description": "data is invalid against innermost type check",
91 "data": "hello",
92 "valid": false
93 }
94 ]
95 }
96 ]