Skip to content

Commit c268421

Browse files
committed
Remove unnecessary type validation from unevaluatedItems tests.
For "real life" schemas, this is likely the desired behavior, but in these tests it's not what's being tested (no results depend on it) and essentially is just extra schema noise.
1 parent 1e0ebd2 commit c268421

File tree

3 files changed

+22
-117
lines changed

3 files changed

+22
-117
lines changed

tests/draft-next/unevaluatedItems.json

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
[
22
{
33
"description": "unevaluatedItems true",
4-
"schema": {
5-
"type": "array",
6-
"unevaluatedItems": true
7-
},
4+
"schema": { "unevaluatedItems": true },
85
"tests": [
96
{
107
"description": "with no unevaluated items",
@@ -20,10 +17,7 @@
2017
},
2118
{
2219
"description": "unevaluatedItems false",
23-
"schema": {
24-
"type": "array",
25-
"unevaluatedItems": false
26-
},
20+
"schema": { "unevaluatedItems": false },
2721
"tests": [
2822
{
2923
"description": "with no unevaluated items",
@@ -39,10 +33,7 @@
3933
},
4034
{
4135
"description": "unevaluatedItems as schema",
42-
"schema": {
43-
"type": "array",
44-
"unevaluatedItems": { "type": "string" }
45-
},
36+
"schema": { "unevaluatedItems": { "type": "string" } },
4637
"tests": [
4738
{
4839
"description": "with no unevaluated items",
@@ -64,7 +55,6 @@
6455
{
6556
"description": "unevaluatedItems with uniform items",
6657
"schema": {
67-
"type": "array",
6858
"items": { "type": "string" },
6959
"unevaluatedItems": false
7060
},
@@ -79,7 +69,6 @@
7969
{
8070
"description": "unevaluatedItems with tuple",
8171
"schema": {
82-
"type": "array",
8372
"prefixItems": [
8473
{ "type": "string" }
8574
],
@@ -101,7 +90,6 @@
10190
{
10291
"description": "unevaluatedItems with items",
10392
"schema": {
104-
"type": "array",
10593
"prefixItems": [
10694
{ "type": "string" }
10795
],
@@ -119,7 +107,6 @@
119107
{
120108
"description": "unevaluatedItems with nested tuple",
121109
"schema": {
122-
"type": "array",
123110
"prefixItems": [
124111
{ "type": "string" }
125112
],
@@ -149,7 +136,6 @@
149136
{
150137
"description": "unevaluatedItems with nested items",
151138
"schema": {
152-
"type": "array",
153139
"allOf": [
154140
{
155141
"prefixItems": [
@@ -176,16 +162,13 @@
176162
{
177163
"description": "unevaluatedItems with nested unevaluatedItems",
178164
"schema": {
179-
"type": "array",
180165
"allOf": [
181166
{
182167
"prefixItems": [
183168
{ "type": "string" }
184169
]
185170
},
186-
{
187-
"unevaluatedItems": true
188-
}
171+
{ "unevaluatedItems": true }
189172
],
190173
"unevaluatedItems": false
191174
},
@@ -205,7 +188,6 @@
205188
{
206189
"description": "unevaluatedItems with anyOf",
207190
"schema": {
208-
"type": "array",
209191
"prefixItems": [
210192
{ "const": "foo" }
211193
],
@@ -252,7 +234,6 @@
252234
{
253235
"description": "unevaluatedItems with oneOf",
254236
"schema": {
255-
"type": "array",
256237
"prefixItems": [
257238
{ "const": "foo" }
258239
],
@@ -288,7 +269,6 @@
288269
{
289270
"description": "unevaluatedItems with not",
290271
"schema": {
291-
"type": "array",
292272
"prefixItems": [
293273
{ "const": "foo" }
294274
],
@@ -313,7 +293,6 @@
313293
{
314294
"description": "unevaluatedItems with if/then/else",
315295
"schema": {
316-
"type": "array",
317296
"prefixItems": [
318297
{ "const": "foo" }
319298
],
@@ -366,7 +345,6 @@
366345
{
367346
"description": "unevaluatedItems with boolean schemas",
368347
"schema": {
369-
"type": "array",
370348
"allOf": [true],
371349
"unevaluatedItems": false
372350
},
@@ -386,7 +364,6 @@
386364
{
387365
"description": "unevaluatedItems with $ref",
388366
"schema": {
389-
"type": "array",
390367
"$ref": "#/$defs/bar",
391368
"prefixItems": [
392369
{ "type": "string" }
@@ -421,9 +398,7 @@
421398
{
422399
"prefixItems": [ true ]
423400
},
424-
{
425-
"unevaluatedItems": false
426-
}
401+
{ "unevaluatedItems": false }
427402
]
428403
},
429404
"tests": [
@@ -437,14 +412,10 @@
437412
{
438413
"description": "item is evaluated in an uncle schema to unevaluatedItems",
439414
"schema": {
440-
"type": "object",
441415
"properties": {
442416
"foo": {
443-
"type": "array",
444417
"prefixItems": [
445-
{
446-
"type": "string"
447-
}
418+
{ "type": "string" }
448419
],
449420
"unevaluatedItems": false
450421
}
@@ -455,9 +426,7 @@
455426
"foo": {
456427
"prefixItems": [
457428
true,
458-
{
459-
"type": "string"
460-
}
429+
{ "type": "string" }
461430
]
462431
}
463432
}

tests/draft2019-09/unevaluatedItems.json

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
[
22
{
33
"description": "unevaluatedItems true",
4-
"schema": {
5-
"type": "array",
6-
"unevaluatedItems": true
7-
},
4+
"schema": { "unevaluatedItems": true },
85
"tests": [
96
{
107
"description": "with no unevaluated items",
@@ -20,10 +17,7 @@
2017
},
2118
{
2219
"description": "unevaluatedItems false",
23-
"schema": {
24-
"type": "array",
25-
"unevaluatedItems": false
26-
},
20+
"schema": { "unevaluatedItems": false },
2721
"tests": [
2822
{
2923
"description": "with no unevaluated items",
@@ -39,10 +33,7 @@
3933
},
4034
{
4135
"description": "unevaluatedItems as schema",
42-
"schema": {
43-
"type": "array",
44-
"unevaluatedItems": { "type": "string" }
45-
},
36+
"schema": { "unevaluatedItems": { "type": "string" } },
4637
"tests": [
4738
{
4839
"description": "with no unevaluated items",
@@ -64,7 +55,6 @@
6455
{
6556
"description": "unevaluatedItems with uniform items",
6657
"schema": {
67-
"type": "array",
6858
"items": { "type": "string" },
6959
"unevaluatedItems": false
7060
},
@@ -79,7 +69,6 @@
7969
{
8070
"description": "unevaluatedItems with tuple",
8171
"schema": {
82-
"type": "array",
8372
"items": [
8473
{ "type": "string" }
8574
],
@@ -101,7 +90,6 @@
10190
{
10291
"description": "unevaluatedItems with additionalItems",
10392
"schema": {
104-
"type": "array",
10593
"items": [
10694
{ "type": "string" }
10795
],
@@ -119,7 +107,6 @@
119107
{
120108
"description": "unevaluatedItems with nested tuple",
121109
"schema": {
122-
"type": "array",
123110
"items": [
124111
{ "type": "string" }
125112
],
@@ -149,7 +136,6 @@
149136
{
150137
"description": "unevaluatedItems with nested additionalItems",
151138
"schema": {
152-
"type": "array",
153139
"allOf": [
154140
{
155141
"items": [
@@ -176,16 +162,13 @@
176162
{
177163
"description": "unevaluatedItems with nested unevaluatedItems",
178164
"schema": {
179-
"type": "array",
180165
"allOf": [
181166
{
182167
"items": [
183168
{ "type": "string" }
184169
]
185170
},
186-
{
187-
"unevaluatedItems": true
188-
}
171+
{ "unevaluatedItems": true }
189172
],
190173
"unevaluatedItems": false
191174
},
@@ -205,7 +188,6 @@
205188
{
206189
"description": "unevaluatedItems with anyOf",
207190
"schema": {
208-
"type": "array",
209191
"items": [
210192
{ "const": "foo" }
211193
],
@@ -252,7 +234,6 @@
252234
{
253235
"description": "unevaluatedItems with oneOf",
254236
"schema": {
255-
"type": "array",
256237
"items": [
257238
{ "const": "foo" }
258239
],
@@ -288,7 +269,6 @@
288269
{
289270
"description": "unevaluatedItems with not",
290271
"schema": {
291-
"type": "array",
292272
"items": [
293273
{ "const": "foo" }
294274
],
@@ -313,10 +293,7 @@
313293
{
314294
"description": "unevaluatedItems with if/then/else",
315295
"schema": {
316-
"type": "array",
317-
"items": [
318-
{ "const": "foo" }
319-
],
296+
"items": [ { "const": "foo" } ],
320297
"if": {
321298
"items": [
322299
true,
@@ -366,7 +343,6 @@
366343
{
367344
"description": "unevaluatedItems with boolean schemas",
368345
"schema": {
369-
"type": "array",
370346
"allOf": [true],
371347
"unevaluatedItems": false
372348
},
@@ -386,7 +362,6 @@
386362
{
387363
"description": "unevaluatedItems with $ref",
388364
"schema": {
389-
"type": "array",
390365
"$ref": "#/$defs/bar",
391366
"items": [
392367
{ "type": "string" }
@@ -421,9 +396,7 @@
421396
{
422397
"items": [ true ]
423398
},
424-
{
425-
"unevaluatedItems": false
426-
}
399+
{ "unevaluatedItems": false }
427400
]
428401
},
429402
"tests": [
@@ -437,14 +410,10 @@
437410
{
438411
"description": "item is evaluated in an uncle schema to unevaluatedItems",
439412
"schema": {
440-
"type": "object",
441413
"properties": {
442414
"foo": {
443-
"type": "array",
444415
"items": [
445-
{
446-
"type": "string"
447-
}
416+
{ "type": "string" }
448417
],
449418
"unevaluatedItems": false
450419
}
@@ -455,9 +424,7 @@
455424
"foo": {
456425
"items": [
457426
true,
458-
{
459-
"type": "string"
460-
}
427+
{ "type": "string" }
461428
]
462429
}
463430
}

0 commit comments

Comments
 (0)