Debian Codegraph @

spec/JSON-Schema-Test-Suite/tests/draft2020-12/unevaluatedProperties.json

raw ◀ ▶
1 Debian patch touch this file
•1 [
2 {
3 "description": "unevaluatedProperties true",
4 "schema": {
5 "type": "object",
6 "unevaluatedProperties": true
7 },
8 "tests": [
9 {
10 "description": "with no unevaluated properties",
11 "data": {},
12 "valid": true
13 },
14 {
15 "description": "with unevaluated properties",
16 "data": {
17 "foo": "foo"
18 },
19 "valid": true
20 }
21 ]
22 },
23 {
24 "description": "unevaluatedProperties schema",
25 "schema": {
26 "type": "object",
27 "unevaluatedProperties": {
28 "type": "string",
29 "minLength": 3
30 }
31 },
32 "tests": [
33 {
34 "description": "with no unevaluated properties",
35 "data": {},
36 "valid": true
37 },
38 {
39 "description": "with valid unevaluated properties",
40 "data": {
41 "foo": "foo"
42 },
43 "valid": true
44 },
45 {
46 "description": "with invalid unevaluated properties",
47 "data": {
48 "foo": "fo"
49 },
50 "valid": false
51 }
52 ]
53 },
54 {
55 "description": "unevaluatedProperties false",
56 "schema": {
57 "type": "object",
58 "unevaluatedProperties": false
59 },
60 "tests": [
61 {
62 "description": "with no unevaluated properties",
63 "data": {},
64 "valid": true
65 },
66 {
67 "description": "with unevaluated properties",
68 "data": {
69 "foo": "foo"
70 },
71 "valid": false
72 }
73 ]
74 },
75 {
76 "description": "unevaluatedProperties with adjacent properties",
77 "schema": {
78 "type": "object",
79 "properties": {
80 "foo": { "type": "string" }
81 },
82 "unevaluatedProperties": false
83 },
84 "tests": [
85 {
86 "description": "with no unevaluated properties",
87 "data": {
88 "foo": "foo"
89 },
90 "valid": true
91 },
92 {
93 "description": "with unevaluated properties",
94 "data": {
95 "foo": "foo",
96 "bar": "bar"
97 },
98 "valid": false
99 }
100 ]
101 },
102 {
103 "description": "unevaluatedProperties with adjacent patternProperties",
104 "schema": {
105 "type": "object",
106 "patternProperties": {
107 "^foo": { "type": "string" }
108 },
109 "unevaluatedProperties": false
110 },
111 "tests": [
112 {
113 "description": "with no unevaluated properties",
114 "data": {
115 "foo": "foo"
116 },
117 "valid": true
118 },
119 {
120 "description": "with unevaluated properties",
121 "data": {
122 "foo": "foo",
123 "bar": "bar"
124 },
125 "valid": false
126 }
127 ]
128 },
129 {
130 "description": "unevaluatedProperties with adjacent additionalProperties",
131 "schema": {
132 "type": "object",
133 "properties": {
134 "foo": { "type": "string" }
135 },
136 "additionalProperties": true,
137 "unevaluatedProperties": false
138 },
139 "tests": [
140 {
141 "description": "with no additional properties",
142 "data": {
143 "foo": "foo"
144 },
145 "valid": true
146 },
147 {
148 "description": "with additional properties",
149 "data": {
150 "foo": "foo",
151 "bar": "bar"
152 },
153 "valid": true
154 }
155 ]
156 },
157 {
158 "description": "unevaluatedProperties with nested properties",
159 "schema": {
160 "type": "object",
161 "properties": {
162 "foo": { "type": "string" }
163 },
164 "allOf": [
165 {
166 "properties": {
167 "bar": { "type": "string" }
168 }
169 }
170 ],
171 "unevaluatedProperties": false
172 },
173 "tests": [
174 {
175 "description": "with no additional properties",
176 "data": {
177 "foo": "foo",
178 "bar": "bar"
179 },
180 "valid": true
181 },
182 {
183 "description": "with additional properties",
184 "data": {
185 "foo": "foo",
186 "bar": "bar",
187 "baz": "baz"
188 },
189 "valid": false
190 }
191 ]
192 },
193 {
194 "description": "unevaluatedProperties with nested patternProperties",
195 "schema": {
196 "type": "object",
197 "properties": {
198 "foo": { "type": "string" }
199 },
200 "allOf": [
201 {
202 "patternProperties": {
203 "^bar": { "type": "string" }
204 }
205 }
206 ],
207 "unevaluatedProperties": false
208 },
209 "tests": [
210 {
211 "description": "with no additional properties",
212 "data": {
213 "foo": "foo",
214 "bar": "bar"
215 },
216 "valid": true
217 },
218 {
219 "description": "with additional properties",
220 "data": {
221 "foo": "foo",
222 "bar": "bar",
223 "baz": "baz"
224 },
225 "valid": false
226 }
227 ]
228 },
229 {
230 "description": "unevaluatedProperties with nested additionalProperties",
231 "schema": {
232 "type": "object",
233 "properties": {
234 "foo": { "type": "string" }
235 },
236 "allOf": [
237 {
238 "additionalProperties": true
239 }
240 ],
241 "unevaluatedProperties": false
242 },
243 "tests": [
244 {
245 "description": "with no additional properties",
246 "data": {
247 "foo": "foo"
248 },
249 "valid": true
250 },
251 {
252 "description": "with additional properties",
253 "data": {
254 "foo": "foo",
255 "bar": "bar"
256 },
257 "valid": true
258 }
259 ]
260 },
261 {
262 "description": "unevaluatedProperties with nested unevaluatedProperties",
263 "schema": {
264 "type": "object",
265 "properties": {
266 "foo": { "type": "string" }
267 },
268 "allOf": [
269 {
270 "unevaluatedProperties": true
271 }
272 ],
273 "unevaluatedProperties": {
274 "type": "string",
275 "maxLength": 2
276 }
277 },
278 "tests": [
279 {
280 "description": "with no nested unevaluated properties",
281 "data": {
282 "foo": "foo"
283 },
284 "valid": true
285 },
286 {
287 "description": "with nested unevaluated properties",
288 "data": {
289 "foo": "foo",
290 "bar": "bar"
291 },
292 "valid": true
293 }
294 ]
295 },
296 {
297 "description": "unevaluatedProperties with anyOf",
298 "schema": {
299 "type": "object",
300 "properties": {
301 "foo": { "type": "string" }
302 },
303 "anyOf": [
304 {
305 "properties": {
306 "bar": { "const": "bar" }
307 },
308 "required": ["bar"]
309 },
310 {
311 "properties": {
312 "baz": { "const": "baz" }
313 },
314 "required": ["baz"]
315 },
316 {
317 "properties": {
318 "quux": { "const": "quux" }
319 },
320 "required": ["quux"]
321 }
322 ],
323 "unevaluatedProperties": false
324 },
325 "tests": [
326 {
327 "description": "when one matches and has no unevaluated properties",
328 "data": {
329 "foo": "foo",
330 "bar": "bar"
331 },
332 "valid": true
333 },
334 {
335 "description": "when one matches and has unevaluated properties",
336 "data": {
337 "foo": "foo",
338 "bar": "bar",
339 "baz": "not-baz"
340 },
341 "valid": false
342 },
343 {
344 "description": "when two match and has no unevaluated properties",
345 "data": {
346 "foo": "foo",
347 "bar": "bar",
348 "baz": "baz"
349 },
350 "valid": true
351 },
352 {
353 "description": "when two match and has unevaluated properties",
354 "data": {
355 "foo": "foo",
356 "bar": "bar",
357 "baz": "baz",
358 "quux": "not-quux"
359 },
360 "valid": false
361 }
362 ]
363 },
364 {
365 "description": "unevaluatedProperties with oneOf",
366 "schema": {
367 "type": "object",
368 "properties": {
369 "foo": { "type": "string" }
370 },
371 "oneOf": [
372 {
373 "properties": {
374 "bar": { "const": "bar" }
375 },
376 "required": ["bar"]
377 },
378 {
379 "properties": {
380 "baz": { "const": "baz" }
381 },
382 "required": ["baz"]
383 }
384 ],
385 "unevaluatedProperties": false
386 },
387 "tests": [
388 {
389 "description": "with no unevaluated properties",
390 "data": {
391 "foo": "foo",
392 "bar": "bar"
393 },
394 "valid": true
395 },
396 {
397 "description": "with unevaluated properties",
398 "data": {
399 "foo": "foo",
400 "bar": "bar",
401 "quux": "quux"
402 },
403 "valid": false
404 }
405 ]
406 },
407 {
408 "description": "unevaluatedProperties with not",
409 "schema": {
410 "type": "object",
411 "properties": {
412 "foo": { "type": "string" }
413 },
414 "not": {
415 "not": {
416 "properties": {
417 "bar": { "const": "bar" }
418 },
419 "required": ["bar"]
420 }
421 },
422 "unevaluatedProperties": false
423 },
424 "tests": [
425 {
426 "description": "with unevaluated properties",
427 "data": {
428 "foo": "foo",
429 "bar": "bar"
430 },
431 "valid": false
432 }
433 ]
434 },
435 {
436 "description": "unevaluatedProperties with if/then/else",
437 "schema": {
438 "type": "object",
439 "if": {
440 "properties": {
441 "foo": { "const": "then" }
442 },
443 "required": ["foo"]
444 },
445 "then": {
446 "properties": {
447 "bar": { "type": "string" }
448 },
449 "required": ["bar"]
450 },
451 "else": {
452 "properties": {
453 "baz": { "type": "string" }
454 },
455 "required": ["baz"]
456 },
457 "unevaluatedProperties": false
458 },
459 "tests": [
460 {
461 "description": "when if is true and has no unevaluated properties",
462 "data": {
463 "foo": "then",
464 "bar": "bar"
465 },
466 "valid": true
467 },
468 {
469 "description": "when if is true and has unevaluated properties",
470 "data": {
471 "foo": "then",
472 "bar": "bar",
473 "baz": "baz"
474 },
475 "valid": false
476 },
477 {
478 "description": "when if is false and has no unevaluated properties",
479 "data": {
480 "baz": "baz"
481 },
482 "valid": true
483 },
484 {
485 "description": "when if is false and has unevaluated properties",
486 "data": {
487 "foo": "else",
488 "baz": "baz"
489 },
490 "valid": false
491 }
492 ]
493 },
494 {
495 "description": "unevaluatedProperties with if/then/else, then not defined",
496 "schema": {
497 "type": "object",
498 "if": {
499 "properties": {
500 "foo": { "const": "then" }
501 },
502 "required": ["foo"]
503 },
504 "else": {
505 "properties": {
506 "baz": { "type": "string" }
507 },
508 "required": ["baz"]
509 },
510 "unevaluatedProperties": false
511 },
512 "tests": [
513 {
514 "description": "when if is true and has no unevaluated properties",
515 "data": {
516 "foo": "then",
517 "bar": "bar"
518 },
519 "valid": false
520 },
521 {
522 "description": "when if is true and has unevaluated properties",
523 "data": {
524 "foo": "then",
525 "bar": "bar",
526 "baz": "baz"
527 },
528 "valid": false
529 },
530 {
531 "description": "when if is false and has no unevaluated properties",
532 "data": {
533 "baz": "baz"
534 },
535 "valid": true
536 },
537 {
538 "description": "when if is false and has unevaluated properties",
539 "data": {
540 "foo": "else",
541 "baz": "baz"
542 },
543 "valid": false
544 }
545 ]
546 },
547 {
548 "description": "unevaluatedProperties with if/then/else, else not defined",
549 "schema": {
550 "type": "object",
551 "if": {
552 "properties": {
553 "foo": { "const": "then" }
554 },
555 "required": ["foo"]
556 },
557 "then": {
558 "properties": {
559 "bar": { "type": "string" }
560 },
561 "required": ["bar"]
562 },
563 "unevaluatedProperties": false
564 },
565 "tests": [
566 {
567 "description": "when if is true and has no unevaluated properties",
568 "data": {
569 "foo": "then",
570 "bar": "bar"
571 },
572 "valid": true
573 },
574 {
575 "description": "when if is true and has unevaluated properties",
576 "data": {
577 "foo": "then",
578 "bar": "bar",
579 "baz": "baz"
580 },
581 "valid": false
582 },
583 {
584 "description": "when if is false and has no unevaluated properties",
585 "data": {
586 "baz": "baz"
587 },
588 "valid": false
589 },
590 {
591 "description": "when if is false and has unevaluated properties",
592 "data": {
593 "foo": "else",
594 "baz": "baz"
595 },
596 "valid": false
597 }
598 ]
599 },
600 {
601 "description": "unevaluatedProperties with dependentSchemas",
602 "schema": {
603 "type": "object",
604 "properties": {
605 "foo": { "type": "string" }
606 },
607 "dependentSchemas": {
608 "foo": {
609 "properties": {
610 "bar": { "const": "bar" }
611 },
612 "required": ["bar"]
613 }
614 },
615 "unevaluatedProperties": false
616 },
617 "tests": [
618 {
619 "description": "with no unevaluated properties",
620 "data": {
621 "foo": "foo",
622 "bar": "bar"
623 },
624 "valid": true
625 },
626 {
627 "description": "with unevaluated properties",
628 "data": {
629 "bar": "bar"
630 },
631 "valid": false
632 }
633 ]
634 },
635 {
636 "description": "unevaluatedProperties with boolean schemas",
637 "schema": {
638 "type": "object",
639 "properties": {
640 "foo": { "type": "string" }
641 },
642 "allOf": [true],
643 "unevaluatedProperties": false
644 },
645 "tests": [
646 {
647 "description": "with no unevaluated properties",
648 "data": {
649 "foo": "foo"
650 },
651 "valid": true
652 },
653 {
654 "description": "with unevaluated properties",
655 "data": {
656 "bar": "bar"
657 },
658 "valid": false
659 }
660 ]
661 },
662 {
663 "description": "unevaluatedProperties with $ref",
664 "schema": {
665 "type": "object",
666 "$ref": "#/$defs/bar",
667 "properties": {
668 "foo": { "type": "string" }
669 },
670 "unevaluatedProperties": false,
671 "$defs": {
672 "bar": {
673 "properties": {
674 "bar": { "type": "string" }
675 }
676 }
677 }
678 },
679 "tests": [
680 {
681 "description": "with no unevaluated properties",
682 "data": {
683 "foo": "foo",
684 "bar": "bar"
685 },
686 "valid": true
687 },
688 {
689 "description": "with unevaluated properties",
690 "data": {
691 "foo": "foo",
692 "bar": "bar",
693 "baz": "baz"
694 },
695 "valid": false
696 }
697 ]
698 },
699 {
700 "description": "unevaluatedProperties can't see inside cousins",
701 "schema": {
702 "allOf": [
703 {
704 "properties": {
705 "foo": true
706 }
707 },
708 {
709 "unevaluatedProperties": false
710 }
711 ]
712 },
713 "tests": [
714 {
715 "description": "always fails",
716 "data": {
717 "foo": 1
718 },
719 "valid": false
720 }
721 ]
722 },
723 {
724 "description": "nested unevaluatedProperties, outer false, inner true, properties outside",
725 "schema": {
726 "type": "object",
727 "properties": {
728 "foo": { "type": "string" }
729 },
730 "allOf": [
731 {
732 "unevaluatedProperties": true
733 }
734 ],
735 "unevaluatedProperties": false
736 },
737 "tests": [
738 {
739 "description": "with no nested unevaluated properties",
740 "data": {
741 "foo": "foo"
742 },
743 "valid": true
744 },
745 {
746 "description": "with nested unevaluated properties",
747 "data": {
748 "foo": "foo",
749 "bar": "bar"
750 },
751 "valid": true
752 }
753 ]
754 },
755 {
756 "description": "nested unevaluatedProperties, outer false, inner true, properties inside",
757 "schema": {
758 "type": "object",
759 "allOf": [
760 {
761 "properties": {
762 "foo": { "type": "string" }
763 },
764 "unevaluatedProperties": true
765 }
766 ],
767 "unevaluatedProperties": false
768 },
769 "tests": [
770 {
771 "description": "with no nested unevaluated properties",
772 "data": {
773 "foo": "foo"
774 },
775 "valid": true
776 },
777 {
778 "description": "with nested unevaluated properties",
779 "data": {
780 "foo": "foo",
781 "bar": "bar"
782 },
783 "valid": true
784 }
785 ]
786 },
787 {
788 "description": "nested unevaluatedProperties, outer true, inner false, properties outside",
789 "schema": {
790 "type": "object",
791 "properties": {
792 "foo": { "type": "string" }
793 },
794 "allOf": [
795 {
796 "unevaluatedProperties": false
797 }
798 ],
799 "unevaluatedProperties": true
800 },
801 "tests": [
802 {
803 "description": "with no nested unevaluated properties",
804 "data": {
805 "foo": "foo"
806 },
807 "valid": false
808 },
809 {
810 "description": "with nested unevaluated properties",
811 "data": {
812 "foo": "foo",
813 "bar": "bar"
814 },
815 "valid": false
816 }
817 ]
818 },
819 {
820 "description": "nested unevaluatedProperties, outer true, inner false, properties inside",
821 "schema": {
822 "type": "object",
823 "allOf": [
824 {
825 "properties": {
826 "foo": { "type": "string" }
827 },
828 "unevaluatedProperties": false
829 }
830 ],
831 "unevaluatedProperties": true
832 },
833 "tests": [
834 {
835 "description": "with no nested unevaluated properties",
836 "data": {
837 "foo": "foo"
838 },
839 "valid": true
840 },
841 {
842 "description": "with nested unevaluated properties",
843 "data": {
844 "foo": "foo",
845 "bar": "bar"
846 },
847 "valid": false
848 }
849 ]
850 },
851 {
852 "description": "cousin unevaluatedProperties, true and false, true with properties",
853 "schema": {
854 "type": "object",
855 "allOf": [
856 {
857 "properties": {
858 "foo": { "type": "string" }
859 },
860 "unevaluatedProperties": true
861 },
862 {
863 "unevaluatedProperties": false
864 }
865 ]
866 },
867 "tests": [
868 {
869 "description": "with no nested unevaluated properties",
870 "data": {
871 "foo": "foo"
872 },
873 "valid": false
874 },
875 {
876 "description": "with nested unevaluated properties",
877 "data": {
878 "foo": "foo",
879 "bar": "bar"
880 },
881 "valid": false
882 }
883 ]
884 },
885 {
886 "description": "cousin unevaluatedProperties, true and false, false with properties",
887 "schema": {
888 "type": "object",
889 "allOf": [
890 {
891 "unevaluatedProperties": true
892 },
893 {
894 "properties": {
895 "foo": { "type": "string" }
896 },
897 "unevaluatedProperties": false
898 }
899 ]
900 },
901 "tests": [
902 {
903 "description": "with no nested unevaluated properties",
904 "data": {
905 "foo": "foo"
906 },
907 "valid": true
908 },
909 {
910 "description": "with nested unevaluated properties",
911 "data": {
912 "foo": "foo",
913 "bar": "bar"
914 },
915 "valid": false
916 }
917 ]
918 },
919 {
920 "description": "property is evaluated in an uncle schema to unevaluatedProperties",
921 "comment": "see https://stackoverflow.com/questions/66936884/deeply-nested-unevaluatedproperties-and-their-expectations",
922 "schema": {
923 "type": "object",
924 "properties": {
925 "foo": {
926 "type": "object",
927 "properties": {
928 "bar": {
929 "type": "string"
930 }
931 },
932 "unevaluatedProperties": false
933 }
934 },
935 "anyOf": [
936 {
937 "properties": {
938 "foo": {
939 "properties": {
940 "faz": {
941 "type": "string"
942 }
943 }
944 }
945 }
946 }
947 ]
948 },
949 "tests": [
950 {
951 "description": "no extra properties",
952 "data": {
953 "foo": {
954 "bar": "test"
955 }
956 },
957 "valid": true
958 },
959 {
960 "description": "uncle keyword evaluation is not significant",
961 "data": {
962 "foo": {
963 "bar": "test",
964 "faz": "test"
965 }
966 },
967 "valid": false
968 }
969 ]
970 },
971 {
972 "description": "in-place applicator siblings, allOf has unevaluated",
973 "schema": {
974 "type": "object",
975 "allOf": [
976 {
977 "properties": {
978 "foo": true
979 },
980 "unevaluatedProperties": false
981 }
982 ],
983 "anyOf": [
984 {
985 "properties": {
986 "bar": true
987 }
988 }
989 ]
990 },
991 "tests": [
992 {
993 "description": "base case: both properties present",
994 "data": {
995 "foo": 1,
996 "bar": 1
997 },
998 "valid": false
999 },
1000 {
1001 "description": "in place applicator siblings, bar is missing",
1002 "data": {
1003 "foo": 1
1004 },
1005 "valid": true
1006 },
1007 {
1008 "description": "in place applicator siblings, foo is missing",
1009 "data": {
1010 "bar": 1
1011 },
1012 "valid": false
1013 }
1014 ]
1015 },
1016 {
1017 "description": "in-place applicator siblings, anyOf has unevaluated",
1018 "schema": {
1019 "type": "object",
1020 "allOf": [
1021 {
1022 "properties": {
1023 "foo": true
1024 }
1025 }
1026 ],
1027 "anyOf": [
1028 {
1029 "properties": {
1030 "bar": true
1031 },
1032 "unevaluatedProperties": false
1033 }
1034 ]
1035 },
1036 "tests": [
1037 {
1038 "description": "base case: both properties present",
1039 "data": {
1040 "foo": 1,
1041 "bar": 1
1042 },
1043 "valid": false
1044 },
1045 {
1046 "description": "in place applicator siblings, bar is missing",
1047 "data": {
1048 "foo": 1
1049 },
1050 "valid": false
1051 },
1052 {
1053 "description": "in place applicator siblings, foo is missing",
1054 "data": {
1055 "bar": 1
1056 },
1057 "valid": true
1058 }
1059 ]
1060 },
1061 {
1062 "description": "unevaluatedProperties + single cyclic ref",
1063 "schema": {
1064 "type": "object",
1065 "properties": {
1066 "x": { "$ref": "#" }
1067 },
1068 "unevaluatedProperties": false
1069 },
1070 "tests": [
1071 {
1072 "description": "Empty is valid",
1073 "data": {},
1074 "valid": true
1075 },
1076 {
1077 "description": "Single is valid",
1078 "data": { "x": {} },
1079 "valid": true
1080 },
1081 {
1082 "description": "Unevaluated on 1st level is invalid",
1083 "data": { "x": {}, "y": {} },
1084 "valid": false
1085 },
1086 {
1087 "description": "Nested is valid",
1088 "data": { "x": { "x": {} } },
1089 "valid": true
1090 },
1091 {
1092 "description": "Unevaluated on 2nd level is invalid",
1093 "data": { "x": { "x": {}, "y": {} } },
1094 "valid": false
1095 },
1096 {
1097 "description": "Deep nested is valid",
1098 "data": { "x": { "x": { "x": {} } } },
1099 "valid": true
1100 },
1101 {
1102 "description": "Unevaluated on 3rd level is invalid",
1103 "data": { "x": { "x": { "x": {}, "y": {} } } },
1104 "valid": false
1105 }
1106 ]
1107 },
1108 {
1109 "description": "unevaluatedProperties + ref inside allOf / oneOf",
1110 "schema": {
1111 "$defs": {
1112 "one": {
1113 "properties": { "a": true }
1114 },
1115 "two": {
1116 "required": ["x"],
1117 "properties": { "x": true }
1118 }
1119 },
1120 "allOf": [
1121 { "$ref": "#/$defs/one" },
1122 { "properties": { "b": true } },
1123 {
1124 "oneOf": [
1125 { "$ref": "#/$defs/two" },
1126 {
1127 "required": ["y"],
1128 "properties": { "y": true }
1129 }
1130 ]
1131 }
1132 ],
1133 "unevaluatedProperties": false
1134 },
1135 "tests": [
1136 {
1137 "description": "Empty is invalid (no x or y)",
1138 "data": {},
1139 "valid": false
1140 },
1141 {
1142 "description": "a and b are invalid (no x or y)",
1143 "data": { "a": 1, "b": 1 },
1144 "valid": false
1145 },
1146 {
1147 "description": "x and y are invalid",
1148 "data": { "x": 1, "y": 1 },
1149 "valid": false
1150 },
1151 {
1152 "description": "a and x are valid",
1153 "data": { "a": 1, "x": 1 },
1154 "valid": true
1155 },
1156 {
1157 "description": "a and y are valid",
1158 "data": { "a": 1, "y": 1 },
1159 "valid": true
1160 },
1161 {
1162 "description": "a and b and x are valid",
1163 "data": { "a": 1, "b": 1, "x": 1 },
1164 "valid": true
1165 },
1166 {
1167 "description": "a and b and y are valid",
1168 "data": { "a": 1, "b": 1, "y": 1 },
1169 "valid": true
1170 },
1171 {
1172 "description": "a and b and x and y are invalid",
1173 "data": { "a": 1, "b": 1, "x": 1, "y": 1 },
1174 "valid": false
1175 }
1176 ]
1177 },
1178 {
1179 "description": "dynamic evalation inside nested refs",
1180 "schema": {
1181 "$defs": {
1182 "one": {
1183 "oneOf": [
1184 { "$ref": "#/$defs/two" },
1185 { "required": ["b"], "properties": { "b": true } },
1186 { "required": ["xx"], "patternProperties": { "x": true } },
1187 { "required": ["all"], "unevaluatedProperties": true }
1188 ]
1189 },
1190 "two": {
1191 "oneOf": [
1192 { "required": ["c"], "properties": { "c": true } },
1193 { "required": ["d"], "properties": { "d": true } }
1194 ]
1195 }
1196 },
1197 "oneOf": [
1198 { "$ref": "#/$defs/one" },
1199 { "required": ["a"], "properties": { "a": true } }
1200 ],
1201 "unevaluatedProperties": false
1202 },
1203 "tests": [
1204 {
1205 "description": "Empty is invalid",
1206 "data": {},
1207 "valid": false
1208 },
1209 {
1210 "description": "a is valid",
1211 "data": { "a": 1 },
1212 "valid": true
1213 },
1214 {
1215 "description": "b is valid",
1216 "data": { "b": 1 },
1217 "valid": true
1218 },
1219 {
1220 "description": "c is valid",
1221 "data": { "c": 1 },
1222 "valid": true
1223 },
1224 {
1225 "description": "d is valid",
1226 "data": { "d": 1 },
1227 "valid": true
1228 },
1229 {
1230 "description": "a + b is invalid",
1231 "data": { "a": 1, "b": 1 },
1232 "valid": false
1233 },
1234 {
1235 "description": "a + c is invalid",
1236 "data": { "a": 1, "c": 1 },
1237 "valid": false
1238 },
1239 {
1240 "description": "a + d is invalid",
1241 "data": { "a": 1, "d": 1 },
1242 "valid": false
1243 },
1244 {
1245 "description": "b + c is invalid",
1246 "data": { "b": 1, "c": 1 },
1247 "valid": false
1248 },
1249 {
1250 "description": "b + d is invalid",
1251 "data": { "b": 1, "d": 1 },
1252 "valid": false
1253 },
1254 {
1255 "description": "c + d is invalid",
1256 "data": { "c": 1, "d": 1 },
1257 "valid": false
1258 },
1259 {
1260 "description": "xx is valid",
1261 "data": { "xx": 1 },
1262 "valid": true
1263 },
1264 {
1265 "description": "xx + foox is valid",
1266 "data": { "xx": 1, "foox": 1 },
1267 "valid": true
1268 },
1269 {
1270 "description": "xx + foo is invalid",
1271 "data": { "xx": 1, "foo": 1 },
1272 "valid": false
1273 },
1274 {
1275 "description": "xx + a is invalid",
1276 "data": { "xx": 1, "a": 1 },
1277 "valid": false
1278 },
1279 {
1280 "description": "xx + b is invalid",
1281 "data": { "xx": 1, "b": 1 },
1282 "valid": false
1283 },
1284 {
1285 "description": "xx + c is invalid",
1286 "data": { "xx": 1, "c": 1 },
1287 "valid": false
1288 },
1289 {
1290 "description": "xx + d is invalid",
1291 "data": { "xx": 1, "d": 1 },
1292 "valid": false
1293 },
1294 {
1295 "description": "all is valid",
1296 "data": { "all": 1 },
1297 "valid": true
1298 },
1299 {
1300 "description": "all + foo is valid",
1301 "data": { "all": 1, "foo": 1 },
1302 "valid": true
1303 },
1304 {
1305 "description": "all + a is invalid",
1306 "data": { "all": 1, "a": 1 },
1307 "valid": false
1308 }
1309 ]
1310 }
1311 ]