Skip to content

Commit be49e5b

Browse files
committed
Add $schema to all 2019-09 tests
1 parent 64793fe commit be49e5b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+739
-124
lines changed

tests/draft2019-09/additionalItems.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
"description": "additionalItems as schema",
44
"schema": {
5+
"$schema": "https://json-schema.org/draft/2019-09/schema",
56
"items": [{}],
67
"additionalItems": {"type": "integer"}
78
},
@@ -21,6 +22,7 @@
2122
{
2223
"description": "when items is schema, additionalItems does nothing",
2324
"schema": {
25+
"$schema": "https://json-schema.org/draft/2019-09/schema",
2426
"items": {},
2527
"additionalItems": false
2628
},
@@ -35,6 +37,7 @@
3537
{
3638
"description": "array of items with no additionalItems permitted",
3739
"schema": {
40+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3841
"items": [{}, {}, {}],
3942
"additionalItems": false
4043
},
@@ -68,7 +71,10 @@
6871
},
6972
{
7073
"description": "additionalItems as false without items",
71-
"schema": {"additionalItems": false},
74+
"schema": {
75+
"$schema": "https://json-schema.org/draft/2019-09/schema",
76+
"additionalItems": false
77+
},
7278
"tests": [
7379
{
7480
"description":
@@ -85,7 +91,10 @@
8591
},
8692
{
8793
"description": "additionalItems are allowed by default",
88-
"schema": {"items": [{"type": "integer"}]},
94+
"schema": {
95+
"$schema": "https://json-schema.org/draft/2019-09/schema",
96+
"items": [{"type": "integer"}]
97+
},
8998
"tests": [
9099
{
91100
"description": "only the first item is validated",
@@ -97,6 +106,7 @@
97106
{
98107
"description": "additionalItems does not look in applicators, valid case",
99108
"schema": {
109+
"$schema": "https://json-schema.org/draft/2019-09/schema",
100110
"allOf": [
101111
{ "items": [ { "type": "integer" } ] }
102112
],
@@ -113,6 +123,7 @@
113123
{
114124
"description": "additionalItems does not look in applicators, invalid case",
115125
"schema": {
126+
"$schema": "https://json-schema.org/draft/2019-09/schema",
116127
"allOf": [
117128
{ "items": [ { "type": "integer" }, { "type": "string" } ] }
118129
],
@@ -130,6 +141,7 @@
130141
{
131142
"description": "items validation adjusts the starting index for additionalItems",
132143
"schema": {
144+
"$schema": "https://json-schema.org/draft/2019-09/schema",
133145
"items": [ { "type": "string" } ],
134146
"additionalItems": { "type": "integer" }
135147
},
@@ -149,6 +161,7 @@
149161
{
150162
"description": "additionalItems with null instance elements",
151163
"schema": {
164+
"$schema": "https://json-schema.org/draft/2019-09/schema",
152165
"additionalItems": {
153166
"type": "null"
154167
}

tests/draft2019-09/additionalProperties.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"description":
44
"additionalProperties being false does not allow other properties",
55
"schema": {
6+
"$schema": "https://json-schema.org/draft/2019-09/schema",
67
"properties": {"foo": {}, "bar": {}},
78
"patternProperties": { "^v": {} },
89
"additionalProperties": false
@@ -43,6 +44,7 @@
4344
{
4445
"description": "non-ASCII pattern with additionalProperties",
4546
"schema": {
47+
"$schema": "https://json-schema.org/draft/2019-09/schema",
4648
"patternProperties": {"^á": {}},
4749
"additionalProperties": false
4850
},
@@ -62,6 +64,7 @@
6264
{
6365
"description": "additionalProperties with schema",
6466
"schema": {
67+
"$schema": "https://json-schema.org/draft/2019-09/schema",
6568
"properties": {"foo": {}, "bar": {}},
6669
"additionalProperties": {"type": "boolean"}
6770
},
@@ -87,6 +90,7 @@
8790
"description":
8891
"additionalProperties can exist by itself",
8992
"schema": {
93+
"$schema": "https://json-schema.org/draft/2019-09/schema",
9094
"additionalProperties": {"type": "boolean"}
9195
},
9296
"tests": [
@@ -104,7 +108,10 @@
104108
},
105109
{
106110
"description": "additionalProperties are allowed by default",
107-
"schema": {"properties": {"foo": {}, "bar": {}}},
111+
"schema": {
112+
"$schema": "https://json-schema.org/draft/2019-09/schema",
113+
"properties": {"foo": {}, "bar": {}}
114+
},
108115
"tests": [
109116
{
110117
"description": "additional properties are allowed",
@@ -116,6 +123,7 @@
116123
{
117124
"description": "additionalProperties does not look in applicators",
118125
"schema": {
126+
"$schema": "https://json-schema.org/draft/2019-09/schema",
119127
"allOf": [
120128
{"properties": {"foo": {}}}
121129
],
@@ -132,6 +140,7 @@
132140
{
133141
"description": "additionalProperties with null valued instance properties",
134142
"schema": {
143+
"$schema": "https://json-schema.org/draft/2019-09/schema",
135144
"additionalProperties": {
136145
"type": "null"
137146
}

tests/draft2019-09/allOf.json

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
"description": "allOf",
44
"schema": {
5+
"$schema": "https://json-schema.org/draft/2019-09/schema",
56
"allOf": [
67
{
78
"properties": {
@@ -43,6 +44,7 @@
4344
{
4445
"description": "allOf with base schema",
4546
"schema": {
47+
"$schema": "https://json-schema.org/draft/2019-09/schema",
4648
"properties": {"bar": {"type": "integer"}},
4749
"required": ["bar"],
4850
"allOf" : [
@@ -91,6 +93,7 @@
9193
{
9294
"description": "allOf simple types",
9395
"schema": {
96+
"$schema": "https://json-schema.org/draft/2019-09/schema",
9497
"allOf": [
9598
{"maximum": 30},
9699
{"minimum": 20}
@@ -111,7 +114,10 @@
111114
},
112115
{
113116
"description": "allOf with boolean schemas, all true",
114-
"schema": {"allOf": [true, true]},
117+
"schema": {
118+
"$schema": "https://json-schema.org/draft/2019-09/schema",
119+
"allOf": [true, true]
120+
},
115121
"tests": [
116122
{
117123
"description": "any value is valid",
@@ -122,7 +128,10 @@
122128
},
123129
{
124130
"description": "allOf with boolean schemas, some false",
125-
"schema": {"allOf": [true, false]},
131+
"schema": {
132+
"$schema": "https://json-schema.org/draft/2019-09/schema",
133+
"allOf": [true, false]
134+
},
126135
"tests": [
127136
{
128137
"description": "any value is invalid",
@@ -133,7 +142,10 @@
133142
},
134143
{
135144
"description": "allOf with boolean schemas, all false",
136-
"schema": {"allOf": [false, false]},
145+
"schema": {
146+
"$schema": "https://json-schema.org/draft/2019-09/schema",
147+
"allOf": [false, false]
148+
},
137149
"tests": [
138150
{
139151
"description": "any value is invalid",
@@ -145,6 +157,7 @@
145157
{
146158
"description": "allOf with one empty schema",
147159
"schema": {
160+
"$schema": "https://json-schema.org/draft/2019-09/schema",
148161
"allOf": [
149162
{}
150163
]
@@ -160,6 +173,7 @@
160173
{
161174
"description": "allOf with two empty schemas",
162175
"schema": {
176+
"$schema": "https://json-schema.org/draft/2019-09/schema",
163177
"allOf": [
164178
{},
165179
{}
@@ -176,6 +190,7 @@
176190
{
177191
"description": "allOf with the first empty schema",
178192
"schema": {
193+
"$schema": "https://json-schema.org/draft/2019-09/schema",
179194
"allOf": [
180195
{},
181196
{ "type": "number" }
@@ -197,6 +212,7 @@
197212
{
198213
"description": "allOf with the last empty schema",
199214
"schema": {
215+
"$schema": "https://json-schema.org/draft/2019-09/schema",
200216
"allOf": [
201217
{ "type": "number" },
202218
{}
@@ -218,6 +234,7 @@
218234
{
219235
"description": "nested allOf, to check validation semantics",
220236
"schema": {
237+
"$schema": "https://json-schema.org/draft/2019-09/schema",
221238
"allOf": [
222239
{
223240
"allOf": [
@@ -244,6 +261,7 @@
244261
{
245262
"description": "allOf combined with anyOf, oneOf",
246263
"schema": {
264+
"$schema": "https://json-schema.org/draft/2019-09/schema",
247265
"allOf": [ { "multipleOf": 2 } ],
248266
"anyOf": [ { "multipleOf": 3 } ],
249267
"oneOf": [ { "multipleOf": 5 } ]

tests/draft2019-09/anchor.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
"description": "Location-independent identifier",
44
"schema": {
5+
"$schema": "https://json-schema.org/draft/2019-09/schema",
56
"$ref": "#foo",
67
"$defs": {
78
"A": {
@@ -26,6 +27,7 @@
2627
{
2728
"description": "Location-independent identifier with absolute URI",
2829
"schema": {
30+
"$schema": "https://json-schema.org/draft/2019-09/schema",
2931
"$ref": "http://localhost:1234/bar#foo",
3032
"$defs": {
3133
"A": {
@@ -51,6 +53,7 @@
5153
{
5254
"description": "Location-independent identifier with base URI change in subschema",
5355
"schema": {
56+
"$schema": "https://json-schema.org/draft/2019-09/schema",
5457
"$id": "http://localhost:1234/root",
5558
"$ref": "http://localhost:1234/nested.json#foo",
5659
"$defs": {
@@ -82,6 +85,7 @@
8285
"description": "$anchor inside an enum is not a real identifier",
8386
"comment": "the implementation must not be confused by an $anchor buried in the enum",
8487
"schema": {
88+
"$schema": "https://json-schema.org/draft/2019-09/schema",
8589
"$defs": {
8690
"anchor_in_enum": {
8791
"enum": [
@@ -138,6 +142,7 @@
138142
{
139143
"description": "same $anchor with different base uri",
140144
"schema": {
145+
"$schema": "https://json-schema.org/draft/2019-09/schema",
141146
"$id": "http://localhost:1234/foobar",
142147
"$defs": {
143148
"A": {
@@ -173,6 +178,7 @@
173178
{
174179
"description": "non-schema object containing an $anchor property",
175180
"schema": {
181+
"$schema": "https://json-schema.org/draft/2019-09/schema",
176182
"$defs": {
177183
"const_not_anchor": {
178184
"const": {
@@ -204,7 +210,10 @@
204210
{
205211
"description": "invalid anchors",
206212
"comment": "Section 8.2.3",
207-
"schema": { "$ref": "https://json-schema.org/draft/2019-09/schema" },
213+
"schema": {
214+
"$schema": "https://json-schema.org/draft/2019-09/schema",
215+
"$ref": "https://json-schema.org/draft/2019-09/schema"
216+
},
208217
"tests": [
209218
{
210219
"description": "MUST start with a letter (and not #)",

tests/draft2019-09/anyOf.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
"description": "anyOf",
44
"schema": {
5+
"$schema": "https://json-schema.org/draft/2019-09/schema",
56
"anyOf": [
67
{
78
"type": "integer"
@@ -37,6 +38,7 @@
3738
{
3839
"description": "anyOf with base schema",
3940
"schema": {
41+
"$schema": "https://json-schema.org/draft/2019-09/schema",
4042
"type": "string",
4143
"anyOf" : [
4244
{
@@ -67,7 +69,10 @@
6769
},
6870
{
6971
"description": "anyOf with boolean schemas, all true",
70-
"schema": {"anyOf": [true, true]},
72+
"schema": {
73+
"$schema": "https://json-schema.org/draft/2019-09/schema",
74+
"anyOf": [true, true]
75+
},
7176
"tests": [
7277
{
7378
"description": "any value is valid",
@@ -78,7 +83,10 @@
7883
},
7984
{
8085
"description": "anyOf with boolean schemas, some true",
81-
"schema": {"anyOf": [true, false]},
86+
"schema": {
87+
"$schema": "https://json-schema.org/draft/2019-09/schema",
88+
"anyOf": [true, false]
89+
},
8290
"tests": [
8391
{
8492
"description": "any value is valid",
@@ -89,7 +97,10 @@
8997
},
9098
{
9199
"description": "anyOf with boolean schemas, all false",
92-
"schema": {"anyOf": [false, false]},
100+
"schema": {
101+
"$schema": "https://json-schema.org/draft/2019-09/schema",
102+
"anyOf": [false, false]
103+
},
93104
"tests": [
94105
{
95106
"description": "any value is invalid",
@@ -101,6 +112,7 @@
101112
{
102113
"description": "anyOf complex types",
103114
"schema": {
115+
"$schema": "https://json-schema.org/draft/2019-09/schema",
104116
"anyOf": [
105117
{
106118
"properties": {
@@ -142,6 +154,7 @@
142154
{
143155
"description": "anyOf with one empty schema",
144156
"schema": {
157+
"$schema": "https://json-schema.org/draft/2019-09/schema",
145158
"anyOf": [
146159
{ "type": "number" },
147160
{}
@@ -163,6 +176,7 @@
163176
{
164177
"description": "nested anyOf, to check validation semantics",
165178
"schema": {
179+
"$schema": "https://json-schema.org/draft/2019-09/schema",
166180
"anyOf": [
167181
{
168182
"anyOf": [

0 commit comments

Comments
 (0)