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 },
54 "tests": [
55 {
56 "description": "empty object",
57 "data": {},
58 "valid": true
59 },
60 {
61 "description": "if passes",
62 "data": {"foo": 3, "arr": [1,2]},
63 "valid": true
64 },
65 {
66 "description": "if passes with valid uneval",
67 "data": {"foo": 3, "arr": [1,2], "uneval": "long-string"},
68 "valid": true
69 },
70 {
71 "description": "if passes with invalid short uneval",
72 "data": {"foo": 3, "arr": [1,2], "uneval": "zz"},
73 "valid": false
74 },
75 {
76 "description": "if fails, and uneval fails because of array",
77 "data": {"foo": "not-an-int", "arr": [1,2], "uneval": "long-string"},
78 "valid": false
79 },
80 {
81 "description": "if fails with valid uneval",
82 "data": {"foo": "not-an-int", "uneval": "long-string"},
83 "valid": true
84 },
85 {
86 "description": "if fails with invalid uneval",
87 "data": {"foo": "zz", "uneval": "long-string"},
88 "valid": false
89 }
90 ]
91 }
92]
View as plain text