Debian Codegraph @

t/additional-tests-draft2020-12/vocabulary.json

raw
1 [
2 {
3 "description": "valid $vocabulary",
4 "schema": {
5 "$id": "https://mymetaschema",
6 "$vocabulary": {
7 "https://json-schema.org/draft/2020-12/vocab/core": true,
8 "https://foo.com": false
9 }
10 },
11 "tests": [
12 {
13 "description": "a valid $vocabulary value",
14 "data": 1,
15 "valid": true
16 }
17 ]
18 },
19 {
20 "description": "invalid $vocabulary (wrong specification version), but not until we evaluate with this metaschema",
21 "schema": {
22 "$id": "https://mymetaschema2",
23 "$vocabulary": {
24 "https://json-schema.org/draft/2019-09/vocab/core": true
25 }
26 },
27 "tests": [
28 {
29 "description": "invalid $vocabulary (wrong specification version): register this metaschema",
30 "data": 1,
31 "valid": true
32 }
33 ]
34 },
35 {
36 "description": "use schema (invalid $vocabulary) as a metaschema",
37 "schema": {
38 "$id": "https://mychema2",
39 "$schema": "https://mymetaschema2"
40 },
41 "tests": [
42 {
43 "description": "invalid $vocabulary value: wrong specification version",
44 "data": 1,
45 "valid": false
46 }
47 ]
48 },
49 {
50 "description": "invalid $vocabulary (unknown URI), but not until we evaluate with this metaschema",
51 "schema": {
52 "$id": "https://mymetaschema3",
53 "$vocabulary": {
54 "https://json-schema.org/draft/2020-12/vocab/core": true,
55 "https://foo.com": true
56 }
57 },
58 "tests": [
59 {
60 "description": "invalid $vocabulary (unknown URI): register this metaschema",
61 "data": 1,
62 "valid": true
63 }
64 ]
65 },
66 {
67 "description": "use schema (unknown URI) as a metaschema",
68 "schema": {
69 "$id": "https://myschema3",
70 "$schema": "https://mymetaschema3"
71 },
72 "tests": [
73 {
74 "description": "invalid $vocabulary value: unknown URI",
75 "data": 1,
76 "valid": false
77 }
78 ]
79 },
80 {
81 "description": "custom metaschema with format-assertion: false",
82 "schema": {
83 "$id": "https://mymetaschema4/with/format-assertion/false",
84 "$vocabulary": {
85 "https://json-schema.org/draft/2020-12/vocab/core": true,
86 "https://json-schema.org/draft/2020-12/vocab/format-assertion": false
87 }
88 },
89 "tests": [
90 {
91 "description": "custom metaschema is loaded",
92 "data": 1,
93 "valid": true
94 }
95 ]
96 },
97 {
98 "description": "custom metaschema with format-assertion: true",
99 "schema": {
100 "$id": "https://mymetaschema4/with/format-assertion/true",
101 "$vocabulary": {
102 "https://json-schema.org/draft/2020-12/vocab/core": true,
103 "https://json-schema.org/draft/2020-12/vocab/format-assertion": true
104 }
105 },
106 "tests": [
107 {
108 "description": "custom metaschema is loaded",
109 "data": 1,
110 "valid": true
111 }
112 ]
113 },
114 {
115 "description": "schema that uses custom metaschema with format-assertion: false",
116 "schema": {
117 "$id": "https://schema/using/format-assertion/false",
118 "$schema": "https://mymetaschema4/with/format-assertion/false",
119 "format": "ipv4"
120 },
121 "tests": [
122 {
123 "description": "format-assertion: false: valid string",
124 "data": "127.0.0.1",
125 "valid": true
126 },
127 {
128 "description": "format-assertion: false: invalid string",
129 "data": "not-an-ipv4",
130 "valid": false
131 }
132 ]
133 },
134 {
135 "description": "schema that uses custom metaschema with format-assertion: true",
136 "schema": {
137 "$id": "https://schema/using/format-assertion/true",
138 "$schema": "https://mymetaschema4/with/format-assertion/true",
139 "format": "ipv4"
140 },
141 "tests": [
142 {
143 "description": "format-assertion: true: valid string",
144 "data": "127.0.0.1",
145 "valid": true
146 },
147 {
148 "description": "format-assertion: true: invalid string",
149 "data": "not-an-ipv4",
150 "valid": false
151 }
152 ]
153 }
154 ]