Debian Codegraph @

share/tests/draft2020-12/optional/refOfUnknownKeyword.json

raw
1 [
2 {
3 "description": "reference of a root arbitrary keyword ",
4 "schema": {
5 "$schema": "https://json-schema.org/draft/2020-12/schema",
6 "unknown-keyword": {"type": "integer"},
7 "properties": {
8 "bar": {"$ref": "#/unknown-keyword"}
9 }
10 },
11 "tests": [
12 {
13 "description": "match",
14 "data": {"bar": 3},
15 "valid": true
16 },
17 {
18 "description": "mismatch",
19 "data": {"bar": true},
20 "valid": false
21 }
22 ]
23 },
24 {
25 "description": "reference of a root arbitrary keyword with encoded ref",
26 "schema": {
27 "$schema": "https://json-schema.org/draft/2020-12/schema",
28 "unknown/keyword": {"type": "integer"},
29 "properties": {
30 "bar": {"$ref": "#/unknown~1keyword"}
31 }
32 },
33 "tests": [
34 {
35 "description": "match",
36 "data": {"bar": 3},
37 "valid": true
38 },
39 {
40 "description": "mismatch",
41 "data": {"bar": true},
42 "valid": false
43 }
44 ]
45 },
46 {
47 "description": "reference of an arbitrary keyword of a sub-schema",
48 "schema": {
49 "$schema": "https://json-schema.org/draft/2020-12/schema",
50 "properties": {
51 "foo": {"unknown-keyword": {"type": "integer"}},
52 "bar": {"$ref": "#/properties/foo/unknown-keyword"}
53 }
54 },
55 "tests": [
56 {
57 "description": "match",
58 "data": {"bar": 3},
59 "valid": true
60 },
61 {
62 "description": "mismatch",
63 "data": {"bar": true},
64 "valid": false
65 }
66 ]
67 },
68 {
69 "description": "reference internals of known non-applicator",
70 "schema": {
71 "$schema": "https://json-schema.org/draft/2020-12/schema",
72 "$id": "/base",
73 "examples": [
74 { "type": "string" }
75 ],
76 "$ref": "#/examples/0"
77 },
78 "tests": [
79 {
80 "description": "match",
81 "data": "a string",
82 "valid": true
83 },
84 {
85 "description": "mismatch",
86 "data": 42,
87 "valid": false
88 }
89 ]
90 },
91 {
92 "description": "reference of an arbitrary keyword of a sub-schema with encoded ref",
93 "schema": {
94 "$schema": "https://json-schema.org/draft/2020-12/schema",
95 "properties": {
96 "foo": {"unknown/keyword": {"type": "integer"}},
97 "bar": {"$ref": "#/properties/foo/unknown~1keyword"}
98 }
99 },
100 "tests": [
101 {
102 "description": "match",
103 "data": {"bar": 3},
104 "valid": true
105 },
106 {
107 "description": "mismatch",
108 "data": {"bar": true},
109 "valid": false
110 }
111 ]
112 }
113 ]