|
3 | 3 | "description": "unevaluatedProperties true", |
4 | 4 | "schema": { |
5 | 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
6 | | - "type": "object", |
7 | 6 | "unevaluatedProperties": true |
8 | 7 | }, |
9 | 8 | "tests": [ |
|
25 | 24 | "description": "unevaluatedProperties schema", |
26 | 25 | "schema": { |
27 | 26 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
28 | | - "type": "object", |
29 | 27 | "unevaluatedProperties": { |
30 | 28 | "type": "string", |
31 | 29 | "minLength": 3 |
|
57 | 55 | "description": "unevaluatedProperties false", |
58 | 56 | "schema": { |
59 | 57 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
60 | | - "type": "object", |
61 | 58 | "unevaluatedProperties": false |
62 | 59 | }, |
63 | 60 | "tests": [ |
|
79 | 76 | "description": "unevaluatedProperties with adjacent properties", |
80 | 77 | "schema": { |
81 | 78 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
82 | | - "type": "object", |
83 | 79 | "properties": { |
84 | 80 | "foo": { "type": "string" } |
85 | 81 | }, |
|
107 | 103 | "description": "unevaluatedProperties with adjacent patternProperties", |
108 | 104 | "schema": { |
109 | 105 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
110 | | - "type": "object", |
111 | 106 | "patternProperties": { |
112 | 107 | "^foo": { "type": "string" } |
113 | 108 | }, |
|
132 | 127 | ] |
133 | 128 | }, |
134 | 129 | { |
135 | | - "description": "unevaluatedProperties with adjacent additionalProperties", |
| 130 | + "description": "unevaluatedProperties with adjacent bool additionalProperties", |
136 | 131 | "schema": { |
137 | 132 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
138 | | - "type": "object", |
139 | | - "properties": { |
140 | | - "foo": { "type": "string" } |
141 | | - }, |
142 | 133 | "additionalProperties": true, |
143 | 134 | "unevaluatedProperties": false |
144 | 135 | }, |
|
160 | 151 | } |
161 | 152 | ] |
162 | 153 | }, |
| 154 | + { |
| 155 | + "description": "unevaluatedProperties with adjacent non-bool additionalProperties", |
| 156 | + "schema": { |
| 157 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 158 | + "additionalProperties": { "type": "string" }, |
| 159 | + "unevaluatedProperties": false |
| 160 | + }, |
| 161 | + "tests": [ |
| 162 | + { |
| 163 | + "description": "with only valid additional properties", |
| 164 | + "data": { |
| 165 | + "foo": "foo" |
| 166 | + }, |
| 167 | + "valid": true |
| 168 | + }, |
| 169 | + { |
| 170 | + "description": "with invalid additional properties", |
| 171 | + "data": { |
| 172 | + "foo": "foo", |
| 173 | + "bar": 1 |
| 174 | + }, |
| 175 | + "valid": false |
| 176 | + } |
| 177 | + ] |
| 178 | + }, |
163 | 179 | { |
164 | 180 | "description": "unevaluatedProperties with nested properties", |
165 | 181 | "schema": { |
166 | 182 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
167 | | - "type": "object", |
168 | 183 | "properties": { |
169 | 184 | "foo": { "type": "string" } |
170 | 185 | }, |
|
201 | 216 | "description": "unevaluatedProperties with nested patternProperties", |
202 | 217 | "schema": { |
203 | 218 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
204 | | - "type": "object", |
205 | 219 | "properties": { |
206 | 220 | "foo": { "type": "string" } |
207 | 221 | }, |
|
238 | 252 | "description": "unevaluatedProperties with nested additionalProperties", |
239 | 253 | "schema": { |
240 | 254 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
241 | | - "type": "object", |
242 | 255 | "properties": { |
243 | 256 | "foo": { "type": "string" } |
244 | 257 | }, |
|
271 | 284 | "description": "unevaluatedProperties with nested unevaluatedProperties", |
272 | 285 | "schema": { |
273 | 286 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
274 | | - "type": "object", |
275 | 287 | "properties": { |
276 | 288 | "foo": { "type": "string" } |
277 | 289 | }, |
|
307 | 319 | "description": "unevaluatedProperties with anyOf", |
308 | 320 | "schema": { |
309 | 321 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
310 | | - "type": "object", |
311 | 322 | "properties": { |
312 | 323 | "foo": { "type": "string" } |
313 | 324 | }, |
|
376 | 387 | "description": "unevaluatedProperties with oneOf", |
377 | 388 | "schema": { |
378 | 389 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
379 | | - "type": "object", |
380 | 390 | "properties": { |
381 | 391 | "foo": { "type": "string" } |
382 | 392 | }, |
|
420 | 430 | "description": "unevaluatedProperties with not", |
421 | 431 | "schema": { |
422 | 432 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
423 | | - "type": "object", |
424 | 433 | "properties": { |
425 | 434 | "foo": { "type": "string" } |
426 | 435 | }, |
|
449 | 458 | "description": "unevaluatedProperties with if/then/else", |
450 | 459 | "schema": { |
451 | 460 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
452 | | - "type": "object", |
453 | 461 | "if": { |
454 | 462 | "properties": { |
455 | 463 | "foo": { "const": "then" } |
|
509 | 517 | "description": "unevaluatedProperties with if/then/else, then not defined", |
510 | 518 | "schema": { |
511 | 519 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
512 | | - "type": "object", |
513 | 520 | "if": { |
514 | 521 | "properties": { |
515 | 522 | "foo": { "const": "then" } |
|
563 | 570 | "description": "unevaluatedProperties with if/then/else, else not defined", |
564 | 571 | "schema": { |
565 | 572 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
566 | | - "type": "object", |
567 | 573 | "if": { |
568 | 574 | "properties": { |
569 | 575 | "foo": { "const": "then" } |
|
617 | 623 | "description": "unevaluatedProperties with dependentSchemas", |
618 | 624 | "schema": { |
619 | 625 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
620 | | - "type": "object", |
621 | 626 | "properties": { |
622 | 627 | "foo": { "type": "string" } |
623 | 628 | }, |
|
653 | 658 | "description": "unevaluatedProperties with boolean schemas", |
654 | 659 | "schema": { |
655 | 660 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
656 | | - "type": "object", |
657 | 661 | "properties": { |
658 | 662 | "foo": { "type": "string" } |
659 | 663 | }, |
|
681 | 685 | "description": "unevaluatedProperties with $ref", |
682 | 686 | "schema": { |
683 | 687 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
684 | | - "type": "object", |
685 | 688 | "$ref": "#/$defs/bar", |
686 | 689 | "properties": { |
687 | 690 | "foo": { "type": "string" } |
|
719 | 722 | "description": "unevaluatedProperties before $ref", |
720 | 723 | "schema": { |
721 | 724 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
722 | | - "type": "object", |
723 | 725 | "unevaluatedProperties": false, |
724 | 726 | "properties": { |
725 | 727 | "foo": { "type": "string" } |
|
773 | 775 |
|
774 | 776 | "$comment": "unevaluatedProperties comes first so it's more likely to catch bugs with implementations that are sensitive to keyword ordering", |
775 | 777 | "unevaluatedProperties": false, |
776 | | - "type": "object", |
777 | 778 | "properties": { |
778 | 779 | "foo": { "type": "string" } |
779 | 780 | }, |
|
862 | 863 | "description": "nested unevaluatedProperties, outer false, inner true, properties outside", |
863 | 864 | "schema": { |
864 | 865 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
865 | | - "type": "object", |
866 | 866 | "properties": { |
867 | 867 | "foo": { "type": "string" } |
868 | 868 | }, |
|
895 | 895 | "description": "nested unevaluatedProperties, outer false, inner true, properties inside", |
896 | 896 | "schema": { |
897 | 897 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
898 | | - "type": "object", |
899 | 898 | "allOf": [ |
900 | 899 | { |
901 | 900 | "properties": { |
|
928 | 927 | "description": "nested unevaluatedProperties, outer true, inner false, properties outside", |
929 | 928 | "schema": { |
930 | 929 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
931 | | - "type": "object", |
932 | 930 | "properties": { |
933 | 931 | "foo": { "type": "string" } |
934 | 932 | }, |
|
961 | 959 | "description": "nested unevaluatedProperties, outer true, inner false, properties inside", |
962 | 960 | "schema": { |
963 | 961 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
964 | | - "type": "object", |
965 | 962 | "allOf": [ |
966 | 963 | { |
967 | 964 | "properties": { |
|
994 | 991 | "description": "cousin unevaluatedProperties, true and false, true with properties", |
995 | 992 | "schema": { |
996 | 993 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
997 | | - "type": "object", |
998 | 994 | "allOf": [ |
999 | 995 | { |
1000 | 996 | "properties": { |
|
1029 | 1025 | "description": "cousin unevaluatedProperties, true and false, false with properties", |
1030 | 1026 | "schema": { |
1031 | 1027 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
1032 | | - "type": "object", |
1033 | 1028 | "allOf": [ |
1034 | 1029 | { |
1035 | 1030 | "unevaluatedProperties": true |
|
1065 | 1060 | "comment": "see https://stackoverflow.com/questions/66936884/deeply-nested-unevaluatedproperties-and-their-expectations", |
1066 | 1061 | "schema": { |
1067 | 1062 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
1068 | | - "type": "object", |
1069 | 1063 | "properties": { |
1070 | 1064 | "foo": { |
1071 | | - "type": "object", |
1072 | 1065 | "properties": { |
1073 | 1066 | "bar": { |
1074 | 1067 | "type": "string" |
|
1117 | 1110 | "description": "in-place applicator siblings, allOf has unevaluated", |
1118 | 1111 | "schema": { |
1119 | 1112 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
1120 | | - "type": "object", |
1121 | 1113 | "allOf": [ |
1122 | 1114 | { |
1123 | 1115 | "properties": { |
|
1163 | 1155 | "description": "in-place applicator siblings, anyOf has unevaluated", |
1164 | 1156 | "schema": { |
1165 | 1157 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
1166 | | - "type": "object", |
1167 | 1158 | "allOf": [ |
1168 | 1159 | { |
1169 | 1160 | "properties": { |
|
1209 | 1200 | "description": "unevaluatedProperties + single cyclic ref", |
1210 | 1201 | "schema": { |
1211 | 1202 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
1212 | | - "type": "object", |
1213 | 1203 | "properties": { |
1214 | 1204 | "x": { "$ref": "#" } |
1215 | 1205 | }, |
|
0 commit comments