1[
2 {
3 "description": "allOf with false unevaluatedProperties",
4 "schema": {
5 "$schema": "https://json-schema.org/draft/2019-09/schema",
6 "unevaluatedProperties": false,
7 "allOf": [
8 {
9 "properties": {
10 "foo": { "type": ["string", "null"] },
11 "bar": { "type": ["string", "null"] }
12 }
13 },
14 {
15 "additionalProperties": {
16 "not": { "enum": [ null ] }
17 }
18 }
19 ]
20 },
21 "tests": [
22 {
23 "description": "string props valid",
24 "data": { "bar": "foo", "bob": "who?" },
25 "valid": true
26 },
27 {
28 "description": "null prop is invalid",
29 "data": { "bar": "foo", "bob": null },
30 "valid": false
31 },
32 {
33 "description": "named property with wrong type is invalid",
34 "data": { "bar": "foo", "bob": "who?" },
35 "valid": true
36 }
37 ]
38 },
39 {
40 "description": "complex unevaluated schema",
41 "schema": {
42 "$schema": "https://json-schema.org/draft/2019-09/schema",
43 "unevaluatedProperties": {
44 "allOf": [{"minLength": 3}, {"type": "string"}]
45 },
46 "if": {
47 "properties": {
48 "foo": {"type": "integer"},
49 "arr": {"type": "array"}
50 },
51 "required": ["foo"]
52 },
53 "then": {
54 "properties": {
55 "foo": {"type": "integer"},
56 "arr": {"type": "array"}
57 },
58 "required": ["foo"]
59 }
60 },
61 "tests": [
62 {
63 "description": "empty object",
64 "data": {},
65 "valid": true
66 },
67 {
68 "description": "if passes",
69 "data": {"foo": 3, "arr": [1,2]},
70 "valid": true
71 },
72 {
73 "description": "if passes with valid uneval",
74 "data": {"foo": 3, "arr": [1,2], "uneval": "long-string"},
75 "valid": true
76 },
77 {
78 "description": "if passes with invalid short uneval",
79 "data": {"foo": 3, "arr": [1,2], "uneval": "zz"},
80 "valid": false
81 },
82 {
83 "description": "if fails, and uneval fails because of array",
84 "data": {"foo": "not-an-int", "arr": [1,2], "uneval": "long-string"},
85 "valid": false
86 },
87 {
88 "description": "if fails with valid uneval",
89 "data": {"foo": "not-an-int", "uneval": "long-string"},
90 "valid": true
91 },
92 {
93 "description": "if fails with invalid uneval",
94 "data": {"foo": "zz", "uneval": "long-string"},
95 "valid": false
96 }
97 ]
98 }
99]
View as plain text