@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 04:45 UTC

next
json 3,970 lines 93 KB
Raw
1 {
2 "cases": [
3 {
4 "id": "flat-all-required-unchanged",
5 "description": "An already-strict schema is returned unchanged with no changes.",
6 "schema": {
7 "type": "object",
8 "properties": {
9 "query": {
10 "type": "string"
11 }
12 },
13 "required": ["query"],
14 "additionalProperties": false
15 },
16 "strict": {
17 "schema": {
18 "type": "object",
19 "properties": {
20 "query": {
21 "type": "string"
22 }
23 },
24 "required": ["query"],
25 "additionalProperties": false
26 }
27 }
28 },
29 {
30 "id": "nested-optional-property-widened",
31 "description": "Optional properties stay, become required and accept null at every depth.",
32 "schema": {
33 "type": "object",
34 "properties": {
35 "cfg": {
36 "type": "object",
37 "properties": {
38 "url": {
39 "type": "string"
40 },
41 "note": {
42 "type": "string",
43 "description": "optional note"
44 }
45 },
46 "required": ["url"]
47 }
48 },
49 "required": ["cfg"]
50 },
51 "strict": {
52 "schema": {
53 "type": "object",
54 "properties": {
55 "cfg": {
56 "type": "object",
57 "properties": {
58 "url": {
59 "type": "string"
60 },
61 "note": {
62 "type": ["string", "null"],
63 "description": "optional note"
64 }
65 },
66 "required": ["url", "note"],
67 "additionalProperties": false
68 }
69 },
70 "required": ["cfg"],
71 "additionalProperties": false
72 }
73 },
74 "changes": [
75 {
76 "path": "properties.cfg.properties.note",
77 "reason": "optional-property-nullable"
78 }
79 ],
80 "arguments": [
81 {
82 "input": {
83 "cfg": {
84 "url": "u",
85 "note": null
86 }
87 },
88 "output": {
89 "cfg": {
90 "url": "u"
91 }
92 }
93 },
94 {
95 "input": {
96 "cfg": null
97 },
98 "output": {}
99 },
100 {
101 "input": {
102 "cfg": {
103 "url": "u",
104 "extra": null
105 }
106 },
107 "output": {
108 "cfg": {
109 "url": "u",
110 "extra": null
111 }
112 }
113 }
114 ]
115 },
116 {
117 "id": "no-required-array-widens-every-property",
118 "description": "An object without `required` requires and widens every property.",
119 "schema": {
120 "type": "object",
121 "properties": {
122 "a": {
123 "type": "string"
124 },
125 "b": {
126 "type": "number"
127 }
128 }
129 },
130 "strict": {
131 "schema": {
132 "type": "object",
133 "properties": {
134 "a": {
135 "type": ["string", "null"]
136 },
137 "b": {
138 "type": ["number", "null"]
139 }
140 },
141 "required": ["a", "b"],
142 "additionalProperties": false
143 }
144 },
145 "changes": [
146 {
147 "path": "properties.a",
148 "reason": "optional-property-nullable"
149 },
150 {
151 "path": "properties.b",
152 "reason": "optional-property-nullable"
153 }
154 ],
155 "arguments": [
156 {
157 "input": {
158 "a": null,
159 "b": 1,
160 "unknown": null
161 },
162 "output": {
163 "b": 1,
164 "unknown": null
165 }
166 }
167 ]
168 },
169 {
170 "id": "required-empty-array-widens-every-property",
171 "description": "An empty `required` array is the same as an absent one.",
172 "schema": {
173 "type": "object",
174 "properties": {
175 "a": {
176 "type": "string"
177 }
178 },
179 "required": []
180 },
181 "strict": {
182 "schema": {
183 "type": "object",
184 "properties": {
185 "a": {
186 "type": ["string", "null"]
187 }
188 },
189 "required": ["a"],
190 "additionalProperties": false
191 }
192 },
193 "changes": [
194 {
195 "path": "properties.a",
196 "reason": "optional-property-nullable"
197 }
198 ]
199 },
200 {
201 "id": "nullable-type-array-kept",
202 "description": "A `type` array with null is accepted by the API and left alone.",
203 "schema": {
204 "type": "object",
205 "properties": {
206 "id": {
207 "type": ["string", "null"],
208 "description": "identifier"
209 }
210 },
211 "required": ["id"]
212 },
213 "strict": {
214 "schema": {
215 "type": "object",
216 "properties": {
217 "id": {
218 "type": ["string", "null"],
219 "description": "identifier"
220 }
221 },
222 "required": ["id"],
223 "additionalProperties": false
224 }
225 },
226 "arguments": [
227 {
228 "input": {
229 "id": null
230 },
231 "output": {
232 "id": null
233 }
234 }
235 ]
236 },
237 {
238 "id": "nullable-object-stays-nullable",
239 "description": "A nullable object keeps its type array; only its own properties are closed.",
240 "schema": {
241 "type": "object",
242 "properties": {
243 "cfg": {
244 "type": ["object", "null"],
245 "properties": {
246 "a": {
247 "type": "string"
248 }
249 },
250 "required": ["a"]
251 }
252 },
253 "required": ["cfg"]
254 },
255 "strict": {
256 "schema": {
257 "type": "object",
258 "properties": {
259 "cfg": {
260 "type": ["object", "null"],
261 "properties": {
262 "a": {
263 "type": "string"
264 }
265 },
266 "required": ["a"],
267 "additionalProperties": false
268 }
269 },
270 "required": ["cfg"],
271 "additionalProperties": false
272 }
273 },
274 "arguments": [
275 {
276 "input": {
277 "cfg": null
278 },
279 "output": {
280 "cfg": null
281 }
282 },
283 {
284 "input": {
285 "cfg": {
286 "a": "x"
287 }
288 },
289 "output": {
290 "cfg": {
291 "a": "x"
292 }
293 }
294 }
295 ]
296 },
297 {
298 "id": "nullable-array-kept",
299 "description": "A nullable array keeps its type array and items.",
300 "schema": {
301 "type": "object",
302 "properties": {
303 "xs": {
304 "type": ["array", "null"],
305 "items": {
306 "type": "string"
307 }
308 }
309 },
310 "required": ["xs"]
311 },
312 "strict": {
313 "schema": {
314 "type": "object",
315 "properties": {
316 "xs": {
317 "type": ["array", "null"],
318 "items": {
319 "type": "string"
320 }
321 }
322 },
323 "required": ["xs"],
324 "additionalProperties": false
325 }
326 },
327 "arguments": [
328 {
329 "input": {
330 "xs": null
331 },
332 "output": {
333 "xs": null
334 }
335 },
336 {
337 "input": {
338 "xs": [null]
339 },
340 "output": {
341 "xs": [null]
342 }
343 }
344 ]
345 },
346 {
347 "id": "optional-any-of-gets-null-branch",
348 "description": "An optional composition gains a null branch instead of a sibling type.",
349 "schema": {
350 "type": "object",
351 "properties": {
352 "value": {
353 "anyOf": [
354 {
355 "type": "string"
356 },
357 {
358 "type": "number"
359 }
360 ]
361 }
362 }
363 },
364 "strict": {
365 "schema": {
366 "type": "object",
367 "properties": {
368 "value": {
369 "anyOf": [
370 {
371 "type": "string"
372 },
373 {
374 "type": "number"
375 },
376 {
377 "type": "null"
378 }
379 ]
380 }
381 },
382 "required": ["value"],
383 "additionalProperties": false
384 }
385 },
386 "changes": [
387 {
388 "path": "properties.value",
389 "reason": "optional-property-nullable"
390 }
391 ]
392 },
393 {
394 "id": "any-of-already-nullable-unchanged",
395 "description": "A composition that already accepts null is not widened twice.",
396 "schema": {
397 "type": "object",
398 "properties": {
399 "value": {
400 "anyOf": [
401 {
402 "type": "string"
403 },
404 {
405 "type": "null"
406 }
407 ]
408 }
409 }
410 },
411 "strict": {
412 "schema": {
413 "type": "object",
414 "properties": {
415 "value": {
416 "anyOf": [
417 {
418 "type": "string"
419 },
420 {
421 "type": "null"
422 }
423 ]
424 }
425 },
426 "required": ["value"],
427 "additionalProperties": false
428 }
429 },
430 "changes": [
431 {
432 "path": "properties.value",
433 "reason": "optional-property-nullable"
434 }
435 ],
436 "arguments": [
437 {
438 "input": {
439 "value": null
440 },
441 "output": {
442 "value": null
443 }
444 }
445 ]
446 },
447 {
448 "id": "optional-enum-only-wrapped",
449 "description": "An enum-only property is wrapped so the annotation stays outside the anyOf.",
450 "schema": {
451 "type": "object",
452 "properties": {
453 "choice": {
454 "enum": ["a", "b"],
455 "description": "pick one",
456 "title": "Choice"
457 }
458 }
459 },
460 "strict": {
461 "schema": {
462 "type": "object",
463 "properties": {
464 "choice": {
465 "description": "pick one",
466 "title": "Choice",
467 "anyOf": [
468 {
469 "enum": ["a", "b"]
470 },
471 {
472 "type": "null"
473 }
474 ]
475 }
476 },
477 "required": ["choice"],
478 "additionalProperties": false
479 }
480 },
481 "changes": [
482 {
483 "path": "properties.choice",
484 "reason": "optional-property-nullable"
485 }
486 ],
487 "arguments": [
488 {
489 "input": {
490 "choice": null
491 },
492 "output": {}
493 }
494 ]
495 },
496 {
497 "id": "optional-const-wrapped",
498 "description": "A const-only property is wrapped in an anyOf with a null branch.",
499 "schema": {
500 "type": "object",
501 "properties": {
502 "kind": {
503 "const": "fixed"
504 }
505 }
506 },
507 "strict": {
508 "schema": {
509 "type": "object",
510 "properties": {
511 "kind": {
512 "anyOf": [
513 {
514 "const": "fixed"
515 },
516 {
517 "type": "null"
518 }
519 ]
520 }
521 },
522 "required": ["kind"],
523 "additionalProperties": false
524 }
525 },
526 "changes": [
527 {
528 "path": "properties.kind",
529 "reason": "optional-property-nullable"
530 }
531 ]
532 },
533 {
534 "id": "optional-empty-schema-unchanged",
535 "description": "An empty schema already accepts null and is left alone.",
536 "schema": {
537 "type": "object",
538 "properties": {
539 "anything": {}
540 }
541 },
542 "strict": {
543 "schema": {
544 "type": "object",
545 "properties": {
546 "anything": {}
547 },
548 "required": ["anything"],
549 "additionalProperties": false
550 }
551 },
552 "changes": [
553 {
554 "path": "properties.anything",
555 "reason": "optional-property-nullable"
556 }
557 ]
558 },
559 {
560 "id": "multi-type-array-gains-null",
561 "description": "A multi-type array gains null instead of being converted to anyOf.",
562 "schema": {
563 "type": "object",
564 "properties": {
565 "value": {
566 "type": ["string", "number"]
567 }
568 }
569 },
570 "strict": {
571 "schema": {
572 "type": "object",
573 "properties": {
574 "value": {
575 "type": ["string", "number", "null"]
576 }
577 },
578 "required": ["value"],
579 "additionalProperties": false
580 }
581 },
582 "changes": [
583 {
584 "path": "properties.value",
585 "reason": "optional-property-nullable"
586 }
587 ]
588 },
589 {
590 "id": "one-of-converted-to-any-of",
591 "description": "oneOf is unsupported and becomes anyOf.",
592 "schema": {
593 "type": "object",
594 "properties": {
595 "either": {
596 "oneOf": [
597 {
598 "type": "string"
599 },
600 {
601 "type": "number"
602 }
603 ]
604 }
605 },
606 "required": ["either"]
607 },
608 "strict": {
609 "schema": {
610 "type": "object",
611 "properties": {
612 "either": {
613 "anyOf": [
614 {
615 "type": "string"
616 },
617 {
618 "type": "number"
619 }
620 ]
621 }
622 },
623 "required": ["either"],
624 "additionalProperties": false
625 }
626 },
627 "changes": [
628 {
629 "path": "properties.either",
630 "reason": "one-of-converted"
631 }
632 ]
633 },
634 {
635 "id": "array-items-object-normalized",
636 "description": "Objects inside array items are closed and widened.",
637 "schema": {
638 "type": "object",
639 "properties": {
640 "rows": {
641 "type": "array",
642 "items": {
643 "type": "object",
644 "properties": {
645 "id": {
646 "type": "string"
647 },
648 "tag": {
649 "type": "string"
650 }
651 },
652 "required": ["id"]
653 }
654 }
655 },
656 "required": ["rows"]
657 },
658 "strict": {
659 "schema": {
660 "type": "object",
661 "properties": {
662 "rows": {
663 "type": "array",
664 "items": {
665 "type": "object",
666 "properties": {
667 "id": {
668 "type": "string"
669 },
670 "tag": {
671 "type": ["string", "null"]
672 }
673 },
674 "required": ["id", "tag"],
675 "additionalProperties": false
676 }
677 }
678 },
679 "required": ["rows"],
680 "additionalProperties": false
681 }
682 },
683 "changes": [
684 {
685 "path": "properties.rows.items.properties.tag",
686 "reason": "optional-property-nullable"
687 }
688 ],
689 "arguments": [
690 {
691 "input": {
692 "rows": [
693 {
694 "id": "1",
695 "tag": null
696 },
697 null
698 ]
699 },
700 "output": {
701 "rows": [
702 {
703 "id": "1"
704 },
705 null
706 ]
707 }
708 }
709 ]
710 },
711 {
712 "id": "default-and-examples-stripped",
713 "description": "Annotation keywords the API rejects are stripped and reported.",
714 "schema": {
715 "type": "object",
716 "properties": {
717 "name": {
718 "type": "string",
719 "examples": ["a"],
720 "default": "x"
721 }
722 },
723 "required": ["name"]
724 },
725 "strict": {
726 "schema": {
727 "type": "object",
728 "properties": {
729 "name": {
730 "type": "string"
731 }
732 },
733 "required": ["name"],
734 "additionalProperties": false
735 }
736 },
737 "changes": [
738 {
739 "path": "properties.name",
740 "reason": "unsupported-keyword-stripped"
741 },
742 {
743 "path": "properties.name",
744 "reason": "unsupported-keyword-stripped"
745 }
746 ]
747 },
748 {
749 "id": "string-format-outside-accepted-list-stripped",
750 "description": "A string `format` the API rejects is stripped and reported, including on a schema without `type` and for an accepted value in the wrong case; formats on numbers and a property named `format` stay.",
751 "schema": {
752 "type": "object",
753 "properties": {
754 "url": {
755 "type": "string",
756 "format": "uri"
757 },
758 "file": {
759 "type": ["string", "null"],
760 "format": "path"
761 },
762 "repos": {
763 "type": "array",
764 "items": {
765 "type": "string",
766 "format": "repo.nwo"
767 }
768 },
769 "untyped": {
770 "format": "uri"
771 },
772 "shouted": {
773 "type": "string",
774 "format": "DATE-TIME"
775 },
776 "count": {
777 "type": "integer",
778 "format": "int64"
779 },
780 "format": {
781 "type": "string",
782 "enum": ["json", "csv"]
783 }
784 },
785 "required": ["url", "file", "repos", "untyped", "shouted", "count", "format"]
786 },
787 "strict": {
788 "schema": {
789 "type": "object",
790 "properties": {
791 "url": {
792 "type": "string"
793 },
794 "file": {
795 "type": ["string", "null"]
796 },
797 "repos": {
798 "type": "array",
799 "items": {
800 "type": "string"
801 }
802 },
803 "untyped": {},
804 "shouted": {
805 "type": "string"
806 },
807 "count": {
808 "type": "integer",
809 "format": "int64"
810 },
811 "format": {
812 "type": "string",
813 "enum": ["json", "csv"]
814 }
815 },
816 "required": ["url", "file", "repos", "untyped", "shouted", "count", "format"],
817 "additionalProperties": false
818 }
819 },
820 "changes": [
821 {
822 "path": "properties.url",
823 "reason": "unsupported-keyword-stripped"
824 },
825 {
826 "path": "properties.file",
827 "reason": "unsupported-keyword-stripped"
828 },
829 {
830 "path": "properties.repos.items",
831 "reason": "unsupported-keyword-stripped"
832 },
833 {
834 "path": "properties.untyped",
835 "reason": "unsupported-keyword-stripped"
836 },
837 {
838 "path": "properties.shouted",
839 "reason": "unsupported-keyword-stripped"
840 }
841 ]
842 },
843 {
844 "id": "accepted-string-formats-kept",
845 "description": "Every string `format` the API accepts is kept unchanged.",
846 "schema": {
847 "type": "object",
848 "properties": {
849 "date-time": {
850 "type": "string",
851 "format": "date-time"
852 },
853 "time": {
854 "type": "string",
855 "format": "time"
856 },
857 "date": {
858 "type": "string",
859 "format": "date"
860 },
861 "duration": {
862 "type": "string",
863 "format": "duration"
864 },
865 "email": {
866 "type": "string",
867 "format": "email"
868 },
869 "hostname": {
870 "type": "string",
871 "format": "hostname"
872 },
873 "ipv4": {
874 "type": "string",
875 "format": "ipv4"
876 },
877 "ipv6": {
878 "type": "string",
879 "format": "ipv6"
880 },
881 "uuid": {
882 "type": "string",
883 "format": "uuid"
884 }
885 },
886 "required": [
887 "date-time",
888 "time",
889 "date",
890 "duration",
891 "email",
892 "hostname",
893 "ipv4",
894 "ipv6",
895 "uuid"
896 ],
897 "additionalProperties": false
898 },
899 "strict": {
900 "schema": {
901 "type": "object",
902 "properties": {
903 "date-time": {
904 "type": "string",
905 "format": "date-time"
906 },
907 "time": {
908 "type": "string",
909 "format": "time"
910 },
911 "date": {
912 "type": "string",
913 "format": "date"
914 },
915 "duration": {
916 "type": "string",
917 "format": "duration"
918 },
919 "email": {
920 "type": "string",
921 "format": "email"
922 },
923 "hostname": {
924 "type": "string",
925 "format": "hostname"
926 },
927 "ipv4": {
928 "type": "string",
929 "format": "ipv4"
930 },
931 "ipv6": {
932 "type": "string",
933 "format": "ipv6"
934 },
935 "uuid": {
936 "type": "string",
937 "format": "uuid"
938 }
939 },
940 "required": [
941 "date-time",
942 "time",
943 "date",
944 "duration",
945 "email",
946 "hostname",
947 "ipv4",
948 "ipv6",
949 "uuid"
950 ],
951 "additionalProperties": false
952 }
953 }
954 },
955 {
956 "id": "openapi-nullable-folded",
957 "description": "OpenAPI `nullable`, which Anthropic rejects on an object, is removed; `true` widens the node to accept null the way the Zod conversion reads it, including on a typed enum, and `false` is dropped.",
958 "schema": {
959 "type": "object",
960 "properties": {
961 "cfg": {
962 "type": "object",
963 "nullable": true,
964 "properties": {
965 "a": {
966 "type": "string"
967 }
968 },
969 "required": ["a"]
970 },
971 "note": {
972 "type": "string",
973 "nullable": true
974 },
975 "mode": {
976 "type": "string",
977 "enum": ["asc", "desc"],
978 "nullable": true
979 },
980 "untyped": {
981 "nullable": true,
982 "description": "anything"
983 },
984 "count": {
985 "type": "integer",
986 "nullable": false
987 },
988 "rows": {
989 "type": "array",
990 "items": {
991 "type": "object",
992 "nullable": true,
993 "properties": {
994 "id": {
995 "type": "string"
996 }
997 }
998 }
999 }
1000 },
1001 "required": ["cfg", "mode", "count", "rows"]
1002 },
1003 "strict": {
1004 "schema": {
1005 "type": "object",
1006 "properties": {
1007 "cfg": {
1008 "type": ["object", "null"],
1009 "properties": {
1010 "a": {
1011 "type": "string"
1012 }
1013 },
1014 "required": ["a"],
1015 "additionalProperties": false
1016 },
1017 "note": {
1018 "type": ["string", "null"]
1019 },
1020 "mode": {
1021 "anyOf": [
1022 {
1023 "type": "string",
1024 "enum": ["asc", "desc"]
1025 },
1026 {
1027 "type": "null"
1028 }
1029 ]
1030 },
1031 "untyped": {
1032 "description": "anything"
1033 },
1034 "count": {
1035 "type": "integer"
1036 },
1037 "rows": {
1038 "type": "array",
1039 "items": {
1040 "type": ["object", "null"],
1041 "properties": {
1042 "id": {
1043 "type": ["string", "null"]
1044 }
1045 },
1046 "required": ["id"],
1047 "additionalProperties": false
1048 }
1049 }
1050 },
1051 "required": ["cfg", "note", "mode", "untyped", "count", "rows"],
1052 "additionalProperties": false
1053 }
1054 },
1055 "changes": [
1056 {
1057 "path": "properties.cfg",
1058 "reason": "nullable-converted"
1059 },
1060 {
1061 "path": "properties.note",
1062 "reason": "nullable-converted"
1063 },
1064 {
1065 "path": "properties.mode",
1066 "reason": "nullable-converted"
1067 },
1068 {
1069 "path": "properties.untyped",
1070 "reason": "unsupported-keyword-stripped"
1071 },
1072 {
1073 "path": "properties.count",
1074 "reason": "unsupported-keyword-stripped"
1075 },
1076 {
1077 "path": "properties.rows.items.properties.id",
1078 "reason": "optional-property-nullable"
1079 },
1080 {
1081 "path": "properties.rows.items",
1082 "reason": "nullable-converted"
1083 },
1084 {
1085 "path": "properties.note",
1086 "reason": "optional-property-nullable"
1087 },
1088 {
1089 "path": "properties.untyped",
1090 "reason": "optional-property-nullable"
1091 }
1092 ],
1093 "arguments": [
1094 {
1095 "input": {
1096 "cfg": null,
1097 "note": null,
1098 "mode": null,
1099 "untyped": null,
1100 "count": null,
1101 "rows": [
1102 null,
1103 {
1104 "id": null
1105 }
1106 ]
1107 },
1108 "output": {
1109 "cfg": null,
1110 "note": null,
1111 "mode": null,
1112 "untyped": null,
1113 "rows": [null, {}]
1114 }
1115 }
1116 ]
1117 },
1118 {
1119 "id": "recursive-nullable-union-gets-null-branch",
1120 "description": "A `nullable: true` union that refers back to itself, or a nullable reference to the root, gains a null branch, because a reference never counts as accepting null here; a reference that does accept null costs a redundant branch.",
1121 "schema": {
1122 "type": "object",
1123 "properties": {
1124 "a": {
1125 "$ref": "#/$defs/A"
1126 },
1127 "b": {
1128 "$ref": "#/$defs/B"
1129 },
1130 "self": {
1131 "$ref": "#",
1132 "nullable": true
1133 }
1134 },
1135 "required": ["a", "b", "self"],
1136 "$defs": {
1137 "A": {
1138 "anyOf": [
1139 {
1140 "$ref": "#/$defs/A"
1141 },
1142 {
1143 "type": "string"
1144 }
1145 ],
1146 "nullable": true
1147 },
1148 "B": {
1149 "anyOf": [
1150 {
1151 "$ref": "#/$defs/Nullable"
1152 },
1153 {
1154 "type": "string"
1155 }
1156 ],
1157 "nullable": true
1158 },
1159 "Nullable": {
1160 "type": ["string", "null"]
1161 }
1162 }
1163 },
1164 "strict": {
1165 "schema": {
1166 "type": "object",
1167 "properties": {
1168 "a": {
1169 "$ref": "#/$defs/A"
1170 },
1171 "b": {
1172 "$ref": "#/$defs/B"
1173 },
1174 "self": {
1175 "anyOf": [
1176 {
1177 "$ref": "#"
1178 },
1179 {
1180 "type": "null"
1181 }
1182 ]
1183 }
1184 },
1185 "required": ["a", "b", "self"],
1186 "$defs": {
1187 "A": {
1188 "anyOf": [
1189 {
1190 "$ref": "#/$defs/A"
1191 },
1192 {
1193 "type": "string"
1194 },
1195 {
1196 "type": "null"
1197 }
1198 ]
1199 },
1200 "B": {
1201 "anyOf": [
1202 {
1203 "$ref": "#/$defs/Nullable"
1204 },
1205 {
1206 "type": "string"
1207 },
1208 {
1209 "type": "null"
1210 }
1211 ]
1212 },
1213 "Nullable": {
1214 "type": ["string", "null"]
1215 }
1216 },
1217 "additionalProperties": false
1218 }
1219 },
1220 "changes": [
1221 {
1222 "path": "properties.self",
1223 "reason": "nullable-converted"
1224 },
1225 {
1226 "path": "$defs.A",
1227 "reason": "nullable-converted"
1228 },
1229 {
1230 "path": "$defs.B",
1231 "reason": "nullable-converted"
1232 }
1233 ],
1234 "arguments": [
1235 {
1236 "input": {
1237 "a": null,
1238 "b": null,
1239 "self": null
1240 },
1241 "output": {
1242 "a": null,
1243 "b": null,
1244 "self": null
1245 }
1246 }
1247 ]
1248 },
1249 {
1250 "id": "enum-values-are-data-not-keywords",
1251 "description": "Keys inside enum/const values are data and must not be treated as keywords.",
1252 "schema": {
1253 "type": "object",
1254 "properties": {
1255 "opts": {
1256 "enum": [
1257 {
1258 "default": 1,
1259 "properties": {}
1260 },
1261 null
1262 ]
1263 }
1264 },
1265 "required": ["opts"]
1266 },
1267 "strict": {
1268 "schema": {
1269 "type": "object",
1270 "properties": {
1271 "opts": {
1272 "enum": [
1273 {
1274 "default": 1,
1275 "properties": {}
1276 },
1277 null
1278 ]
1279 }
1280 },
1281 "required": ["opts"],
1282 "additionalProperties": false
1283 }
1284 },
1285 "arguments": [
1286 {
1287 "input": {
1288 "opts": null
1289 },
1290 "output": {
1291 "opts": null
1292 }
1293 }
1294 ]
1295 },
1296 {
1297 "id": "property-names-are-not-keywords",
1298 "description": "Properties named like keywords are ordinary properties.",
1299 "schema": {
1300 "type": "object",
1301 "properties": {
1302 "default": {
1303 "type": "string"
1304 },
1305 "$ref": {
1306 "type": "string"
1307 },
1308 "type": {
1309 "type": "string"
1310 },
1311 "properties": {
1312 "type": "object",
1313 "properties": {
1314 "x": {
1315 "type": "string"
1316 }
1317 }
1318 }
1319 }
1320 },
1321 "strict": {
1322 "schema": {
1323 "type": "object",
1324 "properties": {
1325 "default": {
1326 "type": ["string", "null"]
1327 },
1328 "$ref": {
1329 "type": ["string", "null"]
1330 },
1331 "type": {
1332 "type": ["string", "null"]
1333 },
1334 "properties": {
1335 "type": ["object", "null"],
1336 "properties": {
1337 "x": {
1338 "type": ["string", "null"]
1339 }
1340 },
1341 "required": ["x"],
1342 "additionalProperties": false
1343 }
1344 },
1345 "required": ["default", "$ref", "type", "properties"],
1346 "additionalProperties": false
1347 }
1348 },
1349 "changes": [
1350 {
1351 "path": "properties.properties.properties.x",
1352 "reason": "optional-property-nullable"
1353 },
1354 {
1355 "path": "properties.default",
1356 "reason": "optional-property-nullable"
1357 },
1358 {
1359 "path": "properties.$ref",
1360 "reason": "optional-property-nullable"
1361 },
1362 {
1363 "path": "properties.type",
1364 "reason": "optional-property-nullable"
1365 },
1366 {
1367 "path": "properties.properties",
1368 "reason": "optional-property-nullable"
1369 }
1370 ],
1371 "arguments": [
1372 {
1373 "input": {
1374 "default": null,
1375 "$ref": "x",
1376 "type": null,
1377 "properties": {
1378 "x": null
1379 }
1380 },
1381 "output": {
1382 "$ref": "x",
1383 "properties": {}
1384 }
1385 }
1386 ]
1387 },
1388 {
1389 "id": "prototype-key-property-name",
1390 "description": "A property named __proto__ or constructor is handled as a plain name.",
1391 "schema": {
1392 "type": "object",
1393 "properties": {
1394 "__proto__": {
1395 "type": "string"
1396 },
1397 "constructor": {
1398 "type": "number"
1399 }
1400 }
1401 },
1402 "strict": {
1403 "schema": {
1404 "type": "object",
1405 "properties": {
1406 "__proto__": {
1407 "type": ["string", "null"]
1408 },
1409 "constructor": {
1410 "type": ["number", "null"]
1411 }
1412 },
1413 "required": ["__proto__", "constructor"],
1414 "additionalProperties": false
1415 }
1416 },
1417 "changes": [
1418 {
1419 "path": "properties.__proto__",
1420 "reason": "optional-property-nullable"
1421 },
1422 {
1423 "path": "properties.constructor",
1424 "reason": "optional-property-nullable"
1425 }
1426 ]
1427 },
1428 {
1429 "id": "schema-valued-additional-properties-unsupported",
1430 "description": "A map-style object cannot be expressed and is reported, not closed.",
1431 "schema": {
1432 "type": "object",
1433 "properties": {
1434 "headers": {
1435 "type": "object",
1436 "additionalProperties": {
1437 "type": "string"
1438 }
1439 }
1440 },
1441 "required": ["headers"]
1442 },
1443 "strict": {
1444 "unsupported": [
1445 {
1446 "path": "properties.headers",
1447 "keyword": "additionalProperties"
1448 }
1449 ]
1450 }
1451 },
1452 {
1453 "id": "additional-properties-true-unsupported",
1454 "description": "An explicitly open object is reported.",
1455 "schema": {
1456 "type": "object",
1457 "properties": {
1458 "open": {
1459 "type": "object",
1460 "additionalProperties": true
1461 }
1462 },
1463 "required": ["open"]
1464 },
1465 "strict": {
1466 "unsupported": [
1467 {
1468 "path": "properties.open",
1469 "keyword": "additionalProperties"
1470 }
1471 ]
1472 }
1473 },
1474 {
1475 "id": "additional-properties-empty-schema-unsupported",
1476 "description": "An empty-schema additionalProperties accepts anything and is reported.",
1477 "schema": {
1478 "type": "object",
1479 "properties": {
1480 "open": {
1481 "type": "object",
1482 "additionalProperties": {}
1483 }
1484 },
1485 "required": ["open"]
1486 },
1487 "strict": {
1488 "unsupported": [
1489 {
1490 "path": "properties.open",
1491 "keyword": "additionalProperties"
1492 }
1493 ]
1494 }
1495 },
1496 {
1497 "id": "free-form-object-unsupported",
1498 "description": "A property-less object accepts arbitrary keys and is reported.",
1499 "schema": {
1500 "type": "object",
1501 "properties": {
1502 "meta": {
1503 "type": "object",
1504 "description": "any json"
1505 }
1506 },
1507 "required": ["meta"]
1508 },
1509 "strict": {
1510 "unsupported": [
1511 {
1512 "path": "properties.meta",
1513 "keyword": "properties"
1514 }
1515 ]
1516 }
1517 },
1518 {
1519 "id": "pattern-properties-unsupported",
1520 "description": "patternProperties cannot be expressed and is reported.",
1521 "schema": {
1522 "type": "object",
1523 "properties": {
1524 "tagged": {
1525 "type": "object",
1526 "patternProperties": {
1527 "^x-": {
1528 "type": "string"
1529 }
1530 }
1531 }
1532 },
1533 "required": ["tagged"]
1534 },
1535 "strict": {
1536 "unsupported": [
1537 {
1538 "path": "properties.tagged",
1539 "keyword": "patternProperties"
1540 }
1541 ]
1542 }
1543 },
1544 {
1545 "id": "empty-closed-object-representable",
1546 "description": "An object closed with no properties is representable.",
1547 "schema": {
1548 "type": "object",
1549 "properties": {
1550 "empty": {
1551 "type": "object",
1552 "additionalProperties": false
1553 }
1554 },
1555 "required": ["empty"]
1556 },
1557 "strict": {
1558 "schema": {
1559 "type": "object",
1560 "properties": {
1561 "empty": {
1562 "type": "object",
1563 "additionalProperties": false,
1564 "properties": {},
1565 "required": []
1566 }
1567 },
1568 "required": ["empty"],
1569 "additionalProperties": false
1570 }
1571 }
1572 },
1573 {
1574 "id": "all-of-unsupported",
1575 "description": "allOf has no lossless rewrite and is reported.",
1576 "schema": {
1577 "type": "object",
1578 "properties": {
1579 "all": {
1580 "allOf": [
1581 {
1582 "type": "string"
1583 }
1584 ]
1585 }
1586 },
1587 "required": ["all"]
1588 },
1589 "strict": {
1590 "unsupported": [
1591 {
1592 "path": "properties.all",
1593 "keyword": "allOf"
1594 }
1595 ]
1596 }
1597 },
1598 {
1599 "id": "prefix-items-unsupported",
1600 "description": "prefixItems has no lossless rewrite and is reported.",
1601 "schema": {
1602 "type": "object",
1603 "properties": {
1604 "pair": {
1605 "type": "array",
1606 "prefixItems": [
1607 {
1608 "type": "number"
1609 }
1610 ]
1611 }
1612 },
1613 "required": ["pair"]
1614 },
1615 "strict": {
1616 "unsupported": [
1617 {
1618 "path": "properties.pair",
1619 "keyword": "prefixItems"
1620 }
1621 ]
1622 }
1623 },
1624 {
1625 "id": "defs-ref-kept-and-definition-normalized",
1626 "description": "Local $refs are kept and the definition is normalized where it is declared.",
1627 "schema": {
1628 "type": "object",
1629 "properties": {
1630 "cfg": {
1631 "$ref": "#/$defs/Config"
1632 }
1633 },
1634 "required": ["cfg"],
1635 "$defs": {
1636 "Config": {
1637 "type": "object",
1638 "properties": {
1639 "url": {
1640 "type": "string"
1641 },
1642 "note": {
1643 "type": "string"
1644 }
1645 },
1646 "required": ["url"]
1647 }
1648 }
1649 },
1650 "strict": {
1651 "schema": {
1652 "type": "object",
1653 "properties": {
1654 "cfg": {
1655 "$ref": "#/$defs/Config"
1656 }
1657 },
1658 "required": ["cfg"],
1659 "$defs": {
1660 "Config": {
1661 "type": "object",
1662 "properties": {
1663 "url": {
1664 "type": "string"
1665 },
1666 "note": {
1667 "type": ["string", "null"]
1668 }
1669 },
1670 "required": ["url", "note"],
1671 "additionalProperties": false
1672 }
1673 },
1674 "additionalProperties": false
1675 }
1676 },
1677 "changes": [
1678 {
1679 "path": "$defs.Config.properties.note",
1680 "reason": "optional-property-nullable"
1681 }
1682 ],
1683 "arguments": [
1684 {
1685 "input": {
1686 "cfg": {
1687 "url": "u",
1688 "note": null
1689 }
1690 },
1691 "output": {
1692 "cfg": {
1693 "url": "u"
1694 }
1695 }
1696 }
1697 ]
1698 },
1699 {
1700 "id": "optional-ref-widened-with-null-branch",
1701 "description": "An optional $ref property is widened with an anyOf null branch.",
1702 "schema": {
1703 "type": "object",
1704 "properties": {
1705 "cfg": {
1706 "$ref": "#/$defs/Config",
1707 "description": "optional"
1708 }
1709 },
1710 "$defs": {
1711 "Config": {
1712 "type": "object",
1713 "properties": {
1714 "url": {
1715 "type": "string"
1716 }
1717 },
1718 "required": ["url"]
1719 }
1720 }
1721 },
1722 "strict": {
1723 "schema": {
1724 "type": "object",
1725 "properties": {
1726 "cfg": {
1727 "description": "optional",
1728 "anyOf": [
1729 {
1730 "$ref": "#/$defs/Config"
1731 },
1732 {
1733 "type": "null"
1734 }
1735 ]
1736 }
1737 },
1738 "$defs": {
1739 "Config": {
1740 "type": "object",
1741 "properties": {
1742 "url": {
1743 "type": "string"
1744 }
1745 },
1746 "required": ["url"],
1747 "additionalProperties": false
1748 }
1749 },
1750 "required": ["cfg"],
1751 "additionalProperties": false
1752 }
1753 },
1754 "changes": [
1755 {
1756 "path": "properties.cfg",
1757 "reason": "optional-property-nullable"
1758 }
1759 ],
1760 "arguments": [
1761 {
1762 "input": {
1763 "cfg": null
1764 },
1765 "output": {}
1766 }
1767 ]
1768 },
1769 {
1770 "id": "recursive-defs-kept",
1771 "description": "Self-recursive definitions are representable.",
1772 "schema": {
1773 "type": "object",
1774 "properties": {
1775 "node": {
1776 "$ref": "#/$defs/Node"
1777 }
1778 },
1779 "required": ["node"],
1780 "$defs": {
1781 "Node": {
1782 "type": "object",
1783 "properties": {
1784 "child": {
1785 "$ref": "#/$defs/Node"
1786 },
1787 "label": {
1788 "type": "string"
1789 }
1790 },
1791 "required": ["label"]
1792 }
1793 }
1794 },
1795 "strict": {
1796 "schema": {
1797 "type": "object",
1798 "properties": {
1799 "node": {
1800 "$ref": "#/$defs/Node"
1801 }
1802 },
1803 "required": ["node"],
1804 "$defs": {
1805 "Node": {
1806 "type": "object",
1807 "properties": {
1808 "child": {
1809 "anyOf": [
1810 {
1811 "$ref": "#/$defs/Node"
1812 },
1813 {
1814 "type": "null"
1815 }
1816 ]
1817 },
1818 "label": {
1819 "type": "string"
1820 }
1821 },
1822 "required": ["child", "label"],
1823 "additionalProperties": false
1824 }
1825 },
1826 "additionalProperties": false
1827 }
1828 },
1829 "changes": [
1830 {
1831 "path": "$defs.Node.properties.child",
1832 "reason": "optional-property-nullable"
1833 }
1834 ],
1835 "arguments": [
1836 {
1837 "input": {
1838 "node": {
1839 "label": "a",
1840 "child": {
1841 "label": "b",
1842 "child": null
1843 }
1844 }
1845 },
1846 "output": {
1847 "node": {
1848 "label": "a",
1849 "child": {
1850 "label": "b"
1851 }
1852 }
1853 }
1854 }
1855 ]
1856 },
1857 {
1858 "id": "mutually-recursive-defs-kept",
1859 "description": "Mutually recursive definitions are representable.",
1860 "schema": {
1861 "type": "object",
1862 "properties": {
1863 "a": {
1864 "$ref": "#/$defs/A"
1865 }
1866 },
1867 "required": ["a"],
1868 "$defs": {
1869 "A": {
1870 "type": "object",
1871 "properties": {
1872 "b": {
1873 "$ref": "#/$defs/B"
1874 }
1875 }
1876 },
1877 "B": {
1878 "type": "object",
1879 "properties": {
1880 "a": {
1881 "$ref": "#/$defs/A"
1882 }
1883 }
1884 }
1885 }
1886 },
1887 "strict": {
1888 "schema": {
1889 "type": "object",
1890 "properties": {
1891 "a": {
1892 "$ref": "#/$defs/A"
1893 }
1894 },
1895 "required": ["a"],
1896 "$defs": {
1897 "A": {
1898 "type": "object",
1899 "properties": {
1900 "b": {
1901 "anyOf": [
1902 {
1903 "$ref": "#/$defs/B"
1904 },
1905 {
1906 "type": "null"
1907 }
1908 ]
1909 }
1910 },
1911 "required": ["b"],
1912 "additionalProperties": false
1913 },
1914 "B": {
1915 "type": "object",
1916 "properties": {
1917 "a": {
1918 "anyOf": [
1919 {
1920 "$ref": "#/$defs/A"
1921 },
1922 {
1923 "type": "null"
1924 }
1925 ]
1926 }
1927 },
1928 "required": ["a"],
1929 "additionalProperties": false
1930 }
1931 },
1932 "additionalProperties": false
1933 }
1934 },
1935 "changes": [
1936 {
1937 "path": "$defs.A.properties.b",
1938 "reason": "optional-property-nullable"
1939 },
1940 {
1941 "path": "$defs.B.properties.a",
1942 "reason": "optional-property-nullable"
1943 }
1944 ]
1945 },
1946 {
1947 "id": "legacy-definitions-ref-kept",
1948 "description": "Legacy definitions are supported like $defs.",
1949 "schema": {
1950 "type": "object",
1951 "properties": {
1952 "cfg": {
1953 "$ref": "#/definitions/Config"
1954 }
1955 },
1956 "required": ["cfg"],
1957 "definitions": {
1958 "Config": {
1959 "type": "object",
1960 "properties": {
1961 "url": {
1962 "type": "string"
1963 }
1964 }
1965 }
1966 }
1967 },
1968 "strict": {
1969 "schema": {
1970 "type": "object",
1971 "properties": {
1972 "cfg": {
1973 "$ref": "#/definitions/Config"
1974 }
1975 },
1976 "required": ["cfg"],
1977 "definitions": {
1978 "Config": {
1979 "type": "object",
1980 "properties": {
1981 "url": {
1982 "type": ["string", "null"]
1983 }
1984 },
1985 "required": ["url"],
1986 "additionalProperties": false
1987 }
1988 },
1989 "additionalProperties": false
1990 }
1991 },
1992 "changes": [
1993 {
1994 "path": "definitions.Config.properties.url",
1995 "reason": "optional-property-nullable"
1996 }
1997 ]
1998 },
1999 {
2000 "id": "ref-into-properties-kept",
2001 "description": "A local $ref outside $defs resolves and is kept.",
2002 "schema": {
2003 "type": "object",
2004 "properties": {
2005 "a": {
2006 "type": "object",
2007 "properties": {
2008 "x": {
2009 "type": "string"
2010 }
2011 },
2012 "required": ["x"]
2013 },
2014 "b": {
2015 "$ref": "#/properties/a"
2016 }
2017 },
2018 "required": ["a", "b"]
2019 },
2020 "strict": {
2021 "schema": {
2022 "type": "object",
2023 "properties": {
2024 "a": {
2025 "type": "object",
2026 "properties": {
2027 "x": {
2028 "type": "string"
2029 }
2030 },
2031 "required": ["x"],
2032 "additionalProperties": false
2033 },
2034 "b": {
2035 "$ref": "#/properties/a"
2036 }
2037 },
2038 "required": ["a", "b"],
2039 "additionalProperties": false
2040 }
2041 }
2042 },
2043 {
2044 "id": "root-ref-kept",
2045 "description": "A local $ref to the document root resolves and is kept.",
2046 "schema": {
2047 "type": "object",
2048 "properties": {
2049 "child": {
2050 "$ref": "#"
2051 },
2052 "label": {
2053 "type": "string"
2054 }
2055 },
2056 "required": ["label"]
2057 },
2058 "strict": {
2059 "schema": {
2060 "type": "object",
2061 "properties": {
2062 "child": {
2063 "anyOf": [
2064 {
2065 "$ref": "#"
2066 },
2067 {
2068 "type": "null"
2069 }
2070 ]
2071 },
2072 "label": {
2073 "type": "string"
2074 }
2075 },
2076 "required": ["child", "label"],
2077 "additionalProperties": false
2078 }
2079 },
2080 "changes": [
2081 {
2082 "path": "properties.child",
2083 "reason": "optional-property-nullable"
2084 }
2085 ]
2086 },
2087 {
2088 "id": "dangling-ref-unsupported",
2089 "description": "A $ref without a target is reported at its own path.",
2090 "schema": {
2091 "type": "object",
2092 "properties": {
2093 "cfg": {
2094 "$ref": "#/$defs/Nope"
2095 }
2096 },
2097 "required": ["cfg"]
2098 },
2099 "strict": {
2100 "unsupported": [
2101 {
2102 "path": "properties.cfg",
2103 "keyword": "$ref"
2104 }
2105 ]
2106 }
2107 },
2108 {
2109 "id": "external-ref-unsupported",
2110 "description": "A $ref outside the document is reported.",
2111 "schema": {
2112 "type": "object",
2113 "properties": {
2114 "cfg": {
2115 "$ref": "https://example.com/schema.json"
2116 }
2117 },
2118 "required": ["cfg"]
2119 },
2120 "strict": {
2121 "unsupported": [
2122 {
2123 "path": "properties.cfg",
2124 "keyword": "$ref"
2125 }
2126 ]
2127 }
2128 },
2129 {
2130 "id": "duplicate-required-deduped",
2131 "description": "Duplicate required entries are removed.",
2132 "schema": {
2133 "type": "object",
2134 "properties": {
2135 "a": {
2136 "type": "string"
2137 }
2138 },
2139 "required": ["a", "a"]
2140 },
2141 "strict": {
2142 "schema": {
2143 "type": "object",
2144 "properties": {
2145 "a": {
2146 "type": "string"
2147 }
2148 },
2149 "required": ["a"],
2150 "additionalProperties": false
2151 }
2152 }
2153 },
2154 {
2155 "id": "required-unknown-names-dropped",
2156 "description": "Required names without a property are dropped from required.",
2157 "schema": {
2158 "type": "object",
2159 "properties": {
2160 "a": {
2161 "type": "string"
2162 }
2163 },
2164 "required": ["a", "ghost"]
2165 },
2166 "strict": {
2167 "schema": {
2168 "type": "object",
2169 "properties": {
2170 "a": {
2171 "type": "string"
2172 }
2173 },
2174 "required": ["a"],
2175 "additionalProperties": false
2176 }
2177 }
2178 },
2179 {
2180 "id": "required-not-an-array-ignored",
2181 "description": "A malformed required is treated as absent.",
2182 "schema": {
2183 "type": "object",
2184 "properties": {
2185 "a": {
2186 "type": "string"
2187 }
2188 },
2189 "required": "a"
2190 },
2191 "strict": {
2192 "schema": {
2193 "type": "object",
2194 "properties": {
2195 "a": {
2196 "type": ["string", "null"]
2197 }
2198 },
2199 "required": ["a"],
2200 "additionalProperties": false
2201 }
2202 },
2203 "changes": [
2204 {
2205 "path": "properties.a",
2206 "reason": "optional-property-nullable"
2207 }
2208 ]
2209 },
2210 {
2211 "id": "description-kept-on-widened-node",
2212 "description": "Annotations survive widening.",
2213 "schema": {
2214 "type": "object",
2215 "properties": {
2216 "a": {
2217 "type": "integer",
2218 "description": "count",
2219 "title": "Count",
2220 "minimum": 0
2221 }
2222 }
2223 },
2224 "strict": {
2225 "schema": {
2226 "type": "object",
2227 "properties": {
2228 "a": {
2229 "type": ["integer", "null"],
2230 "description": "count",
2231 "title": "Count",
2232 "minimum": 0
2233 }
2234 },
2235 "required": ["a"],
2236 "additionalProperties": false
2237 }
2238 },
2239 "changes": [
2240 {
2241 "path": "properties.a",
2242 "reason": "optional-property-nullable"
2243 }
2244 ]
2245 },
2246 {
2247 "id": "non-object-root-unsupported",
2248 "description": "The root must be an object.",
2249 "schema": {
2250 "type": "string"
2251 },
2252 "strict": {
2253 "unsupported": [
2254 {
2255 "path": "",
2256 "keyword": "type"
2257 }
2258 ]
2259 }
2260 },
2261 {
2262 "id": "nullable-root-unsupported",
2263 "description": "The root must not be nullable.",
2264 "schema": {
2265 "type": ["object", "null"],
2266 "properties": {
2267 "a": {
2268 "type": "string"
2269 }
2270 }
2271 },
2272 "strict": {
2273 "unsupported": [
2274 {
2275 "path": "",
2276 "keyword": "type"
2277 }
2278 ]
2279 },
2280 "changes": [
2281 {
2282 "path": "properties.a",
2283 "reason": "optional-property-nullable"
2284 }
2285 ]
2286 },
2287 {
2288 "id": "properties-without-type-become-object",
2289 "description": "A node with properties but no type is treated as an object.",
2290 "schema": {
2291 "type": "object",
2292 "properties": {
2293 "cfg": {
2294 "properties": {
2295 "a": {
2296 "type": "string"
2297 }
2298 }
2299 }
2300 },
2301 "required": ["cfg"]
2302 },
2303 "strict": {
2304 "schema": {
2305 "type": "object",
2306 "properties": {
2307 "cfg": {
2308 "properties": {
2309 "a": {
2310 "type": ["string", "null"]
2311 }
2312 },
2313 "type": "object",
2314 "required": ["a"],
2315 "additionalProperties": false
2316 }
2317 },
2318 "required": ["cfg"],
2319 "additionalProperties": false
2320 }
2321 },
2322 "changes": [
2323 {
2324 "path": "properties.cfg.properties.a",
2325 "reason": "optional-property-nullable"
2326 }
2327 ]
2328 },
2329 {
2330 "id": "root-without-type-become-object",
2331 "description": "A root with properties but no type is treated as an object.",
2332 "schema": {
2333 "properties": {
2334 "a": {
2335 "type": "string"
2336 }
2337 }
2338 },
2339 "strict": {
2340 "schema": {
2341 "properties": {
2342 "a": {
2343 "type": ["string", "null"]
2344 }
2345 },
2346 "type": "object",
2347 "required": ["a"],
2348 "additionalProperties": false
2349 }
2350 },
2351 "changes": [
2352 {
2353 "path": "properties.a",
2354 "reason": "optional-property-nullable"
2355 }
2356 ]
2357 },
2358 {
2359 "id": "root-single-element-type-array-accepted",
2360 "description": "A root typed [\"object\"] is an object root.",
2361 "schema": {
2362 "type": ["object"],
2363 "properties": {
2364 "a": {
2365 "type": "string"
2366 }
2367 },
2368 "required": ["a"]
2369 },
2370 "strict": {
2371 "schema": {
2372 "type": ["object"],
2373 "properties": {
2374 "a": {
2375 "type": "string"
2376 }
2377 },
2378 "required": ["a"],
2379 "additionalProperties": false
2380 }
2381 }
2382 },
2383 {
2384 "id": "three-member-type-array-gains-null",
2385 "description": "A three-member type array gains null once.",
2386 "schema": {
2387 "type": "object",
2388 "properties": {
2389 "v": {
2390 "type": ["string", "number", "boolean"]
2391 }
2392 }
2393 },
2394 "strict": {
2395 "schema": {
2396 "type": "object",
2397 "properties": {
2398 "v": {
2399 "type": ["string", "number", "boolean", "null"]
2400 }
2401 },
2402 "required": ["v"],
2403 "additionalProperties": false
2404 }
2405 },
2406 "changes": [
2407 {
2408 "path": "properties.v",
2409 "reason": "optional-property-nullable"
2410 }
2411 ]
2412 },
2413 {
2414 "id": "optional-null-only-property-unchanged",
2415 "description": "A property typed null already accepts null.",
2416 "schema": {
2417 "type": "object",
2418 "properties": {
2419 "nothing": {
2420 "type": "null"
2421 }
2422 }
2423 },
2424 "strict": {
2425 "schema": {
2426 "type": "object",
2427 "properties": {
2428 "nothing": {
2429 "type": "null"
2430 }
2431 },
2432 "required": ["nothing"],
2433 "additionalProperties": false
2434 }
2435 },
2436 "changes": [
2437 {
2438 "path": "properties.nothing",
2439 "reason": "optional-property-nullable"
2440 }
2441 ],
2442 "arguments": [
2443 {
2444 "input": {
2445 "nothing": null
2446 },
2447 "output": {
2448 "nothing": null
2449 }
2450 }
2451 ]
2452 },
2453 {
2454 "id": "optional-enum-with-null-not-rewrapped",
2455 "description": "An enum that already lists null is not wrapped again.",
2456 "schema": {
2457 "type": "object",
2458 "properties": {
2459 "choice": {
2460 "enum": ["a", null]
2461 }
2462 }
2463 },
2464 "strict": {
2465 "schema": {
2466 "type": "object",
2467 "properties": {
2468 "choice": {
2469 "enum": ["a", null]
2470 }
2471 },
2472 "required": ["choice"],
2473 "additionalProperties": false
2474 }
2475 },
2476 "changes": [
2477 {
2478 "path": "properties.choice",
2479 "reason": "optional-property-nullable"
2480 }
2481 ],
2482 "arguments": [
2483 {
2484 "input": {
2485 "choice": null
2486 },
2487 "output": {
2488 "choice": null
2489 }
2490 }
2491 ]
2492 },
2493 {
2494 "id": "optional-const-null-not-rewrapped",
2495 "description": "A const null already accepts null.",
2496 "schema": {
2497 "type": "object",
2498 "properties": {
2499 "nothing": {
2500 "const": null
2501 }
2502 }
2503 },
2504 "strict": {
2505 "schema": {
2506 "type": "object",
2507 "properties": {
2508 "nothing": {
2509 "const": null
2510 }
2511 },
2512 "required": ["nothing"],
2513 "additionalProperties": false
2514 }
2515 },
2516 "changes": [
2517 {
2518 "path": "properties.nothing",
2519 "reason": "optional-property-nullable"
2520 }
2521 ],
2522 "arguments": [
2523 {
2524 "input": {
2525 "nothing": null
2526 },
2527 "output": {
2528 "nothing": null
2529 }
2530 }
2531 ]
2532 },
2533 {
2534 "id": "nested-any-of-branch-widened",
2535 "description": "Optional properties inside anyOf branches are widened.",
2536 "schema": {
2537 "type": "object",
2538 "properties": {
2539 "v": {
2540 "anyOf": [
2541 {
2542 "type": "object",
2543 "properties": {
2544 "a": {
2545 "type": "string"
2546 }
2547 }
2548 },
2549 {
2550 "type": "string"
2551 }
2552 ]
2553 }
2554 },
2555 "required": ["v"]
2556 },
2557 "strict": {
2558 "schema": {
2559 "type": "object",
2560 "properties": {
2561 "v": {
2562 "anyOf": [
2563 {
2564 "type": "object",
2565 "properties": {
2566 "a": {
2567 "type": ["string", "null"]
2568 }
2569 },
2570 "required": ["a"],
2571 "additionalProperties": false
2572 },
2573 {
2574 "type": "string"
2575 }
2576 ]
2577 }
2578 },
2579 "required": ["v"],
2580 "additionalProperties": false
2581 }
2582 },
2583 "changes": [
2584 {
2585 "path": "properties.v.anyOf[0].properties.a",
2586 "reason": "optional-property-nullable"
2587 }
2588 ],
2589 "arguments": [
2590 {
2591 "input": {
2592 "v": {
2593 "a": null
2594 }
2595 },
2596 "output": {
2597 "v": {}
2598 }
2599 },
2600 {
2601 "input": {
2602 "v": null
2603 },
2604 "output": {}
2605 }
2606 ]
2607 },
2608 {
2609 "id": "array-of-nullable-objects-closed",
2610 "description": "Nullable objects inside array items are closed and stay nullable.",
2611 "schema": {
2612 "type": "object",
2613 "properties": {
2614 "rows": {
2615 "type": "array",
2616 "items": {
2617 "type": ["object", "null"],
2618 "properties": {
2619 "id": {
2620 "type": "string"
2621 }
2622 }
2623 }
2624 }
2625 },
2626 "required": ["rows"]
2627 },
2628 "strict": {
2629 "schema": {
2630 "type": "object",
2631 "properties": {
2632 "rows": {
2633 "type": "array",
2634 "items": {
2635 "type": ["object", "null"],
2636 "properties": {
2637 "id": {
2638 "type": ["string", "null"]
2639 }
2640 },
2641 "required": ["id"],
2642 "additionalProperties": false
2643 }
2644 }
2645 },
2646 "required": ["rows"],
2647 "additionalProperties": false
2648 }
2649 },
2650 "changes": [
2651 {
2652 "path": "properties.rows.items.properties.id",
2653 "reason": "optional-property-nullable"
2654 }
2655 ],
2656 "arguments": [
2657 {
2658 "input": {
2659 "rows": [
2660 null,
2661 {
2662 "id": null
2663 }
2664 ]
2665 },
2666 "output": {
2667 "rows": [null, {}]
2668 }
2669 }
2670 ]
2671 },
2672 {
2673 "id": "tuple-form-items-unsupported",
2674 "description": "Draft-4 tuple items have no strict-mode equivalent.",
2675 "schema": {
2676 "type": "object",
2677 "properties": {
2678 "pair": {
2679 "type": "array",
2680 "items": [
2681 {
2682 "type": "number"
2683 },
2684 {
2685 "type": "string"
2686 }
2687 ]
2688 }
2689 },
2690 "required": ["pair"]
2691 },
2692 "strict": {
2693 "unsupported": [
2694 {
2695 "path": "properties.pair",
2696 "keyword": "items"
2697 }
2698 ]
2699 }
2700 },
2701 {
2702 "id": "boolean-items-unsupported",
2703 "description": "A boolean items subschema is reported.",
2704 "schema": {
2705 "type": "object",
2706 "properties": {
2707 "xs": {
2708 "type": "array",
2709 "items": true
2710 }
2711 },
2712 "required": ["xs"]
2713 },
2714 "strict": {
2715 "unsupported": [
2716 {
2717 "path": "properties.xs",
2718 "keyword": "items"
2719 }
2720 ]
2721 }
2722 },
2723 {
2724 "id": "not-keyword-unsupported",
2725 "description": "not has no strict-mode equivalent.",
2726 "schema": {
2727 "type": "object",
2728 "properties": {
2729 "v": {
2730 "not": {
2731 "type": "string"
2732 }
2733 }
2734 },
2735 "required": ["v"]
2736 },
2737 "strict": {
2738 "unsupported": [
2739 {
2740 "path": "properties.v",
2741 "keyword": "not"
2742 }
2743 ]
2744 }
2745 },
2746 {
2747 "id": "if-then-else-unsupported",
2748 "description": "Conditional keywords have no strict-mode equivalent.",
2749 "schema": {
2750 "type": "object",
2751 "properties": {
2752 "v": {
2753 "type": "string",
2754 "if": {
2755 "minLength": 1
2756 },
2757 "then": {
2758 "maxLength": 5
2759 },
2760 "else": {
2761 "const": ""
2762 }
2763 }
2764 },
2765 "required": ["v"]
2766 },
2767 "strict": {
2768 "unsupported": [
2769 {
2770 "path": "properties.v",
2771 "keyword": "else"
2772 },
2773 {
2774 "path": "properties.v",
2775 "keyword": "if"
2776 },
2777 {
2778 "path": "properties.v",
2779 "keyword": "then"
2780 }
2781 ]
2782 }
2783 },
2784 {
2785 "id": "dependent-schemas-unsupported",
2786 "description": "dependentSchemas has no strict-mode equivalent.",
2787 "schema": {
2788 "type": "object",
2789 "properties": {
2790 "a": {
2791 "type": "string"
2792 }
2793 },
2794 "required": ["a"],
2795 "dependentSchemas": {
2796 "a": {
2797 "type": "object",
2798 "properties": {
2799 "b": {
2800 "type": "string"
2801 }
2802 }
2803 }
2804 }
2805 },
2806 "strict": {
2807 "unsupported": [
2808 {
2809 "path": "",
2810 "keyword": "dependentSchemas"
2811 }
2812 ]
2813 },
2814 "changes": [
2815 {
2816 "path": "dependentSchemas.a.properties.b",
2817 "reason": "optional-property-nullable"
2818 }
2819 ]
2820 },
2821 {
2822 "id": "property-names-keyword-unsupported",
2823 "description": "propertyNames has no strict-mode equivalent.",
2824 "schema": {
2825 "type": "object",
2826 "properties": {
2827 "a": {
2828 "type": "string"
2829 }
2830 },
2831 "required": ["a"],
2832 "propertyNames": {
2833 "pattern": "^a"
2834 }
2835 },
2836 "strict": {
2837 "unsupported": [
2838 {
2839 "path": "",
2840 "keyword": "propertyNames"
2841 }
2842 ]
2843 }
2844 },
2845 {
2846 "id": "one-of-beside-any-of-unsupported",
2847 "description": "oneOf next to anyOf cannot be merged and is reported.",
2848 "schema": {
2849 "type": "object",
2850 "properties": {
2851 "v": {
2852 "anyOf": [
2853 {
2854 "type": "string"
2855 }
2856 ],
2857 "oneOf": [
2858 {
2859 "type": "number"
2860 }
2861 ]
2862 }
2863 },
2864 "required": ["v"]
2865 },
2866 "strict": {
2867 "unsupported": [
2868 {
2869 "path": "properties.v",
2870 "keyword": "oneOf"
2871 }
2872 ]
2873 }
2874 },
2875 {
2876 "id": "boolean-property-subschema-unsupported",
2877 "description": "A boolean property subschema is reported.",
2878 "schema": {
2879 "type": "object",
2880 "properties": {
2881 "anything": true,
2882 "nothing": false
2883 },
2884 "required": ["anything", "nothing"]
2885 },
2886 "strict": {
2887 "unsupported": [
2888 {
2889 "path": "properties.anything",
2890 "keyword": "properties"
2891 },
2892 {
2893 "path": "properties.nothing",
2894 "keyword": "properties"
2895 }
2896 ]
2897 }
2898 },
2899 {
2900 "id": "properties-not-an-object-unsupported",
2901 "description": "A malformed properties value is reported instead of emptied.",
2902 "schema": {
2903 "type": "object",
2904 "properties": "not-a-map",
2905 "required": ["a"]
2906 },
2907 "strict": {
2908 "unsupported": [
2909 {
2910 "path": "",
2911 "keyword": "properties"
2912 }
2913 ]
2914 }
2915 },
2916 {
2917 "id": "ref-with-siblings-kept",
2918 "description": "Sibling keywords next to a $ref are kept.",
2919 "schema": {
2920 "type": "object",
2921 "properties": {
2922 "cfg": {
2923 "$ref": "#/$defs/Config",
2924 "description": "cfg",
2925 "title": "Config"
2926 }
2927 },
2928 "required": ["cfg"],
2929 "$defs": {
2930 "Config": {
2931 "type": "object",
2932 "properties": {
2933 "a": {
2934 "type": "string"
2935 }
2936 },
2937 "required": ["a"]
2938 }
2939 }
2940 },
2941 "strict": {
2942 "schema": {
2943 "type": "object",
2944 "properties": {
2945 "cfg": {
2946 "$ref": "#/$defs/Config",
2947 "description": "cfg",
2948 "title": "Config"
2949 }
2950 },
2951 "required": ["cfg"],
2952 "$defs": {
2953 "Config": {
2954 "type": "object",
2955 "properties": {
2956 "a": {
2957 "type": "string"
2958 }
2959 },
2960 "required": ["a"],
2961 "additionalProperties": false
2962 }
2963 },
2964 "additionalProperties": false
2965 }
2966 }
2967 },
2968 {
2969 "id": "required-non-string-entries-ignored",
2970 "description": "Non-string required entries are ignored.",
2971 "schema": {
2972 "type": "object",
2973 "properties": {
2974 "a": {
2975 "type": "string"
2976 },
2977 "b": {
2978 "type": "string"
2979 }
2980 },
2981 "required": ["a", 1, null]
2982 },
2983 "strict": {
2984 "schema": {
2985 "type": "object",
2986 "properties": {
2987 "a": {
2988 "type": "string"
2989 },
2990 "b": {
2991 "type": ["string", "null"]
2992 }
2993 },
2994 "required": ["a", "b"],
2995 "additionalProperties": false
2996 }
2997 },
2998 "changes": [
2999 {
3000 "path": "properties.b",
3001 "reason": "optional-property-nullable"
3002 }
3003 ]
3004 },
3005 {
3006 "id": "dynamic-keys-reported-once-with-pattern-properties",
3007 "description": "additionalProperties and patternProperties on one node report additionalProperties.",
3008 "schema": {
3009 "type": "object",
3010 "properties": {
3011 "m": {
3012 "type": "object",
3013 "additionalProperties": {
3014 "type": "string"
3015 },
3016 "patternProperties": {
3017 "^x": {
3018 "type": "string"
3019 }
3020 }
3021 }
3022 },
3023 "required": ["m"]
3024 },
3025 "strict": {
3026 "unsupported": [
3027 {
3028 "path": "properties.m",
3029 "keyword": "additionalProperties"
3030 }
3031 ]
3032 }
3033 },
3034 {
3035 "id": "empty-properties-open-object-unsupported",
3036 "description": "An object with empty properties and no closing is free-form.",
3037 "schema": {
3038 "type": "object",
3039 "properties": {
3040 "m": {
3041 "type": "object",
3042 "properties": {}
3043 }
3044 },
3045 "required": ["m"]
3046 },
3047 "strict": {
3048 "unsupported": [
3049 {
3050 "path": "properties.m",
3051 "keyword": "properties"
3052 }
3053 ]
3054 }
3055 },
3056 {
3057 "id": "default-stripped-then-widened",
3058 "description": "Stripping default and widening compose.",
3059 "schema": {
3060 "type": "object",
3061 "properties": {
3062 "a": {
3063 "type": "string",
3064 "default": "x"
3065 }
3066 }
3067 },
3068 "strict": {
3069 "schema": {
3070 "type": "object",
3071 "properties": {
3072 "a": {
3073 "type": ["string", "null"]
3074 }
3075 },
3076 "required": ["a"],
3077 "additionalProperties": false
3078 }
3079 },
3080 "changes": [
3081 {
3082 "path": "properties.a",
3083 "reason": "unsupported-keyword-stripped"
3084 },
3085 {
3086 "path": "properties.a",
3087 "reason": "optional-property-nullable"
3088 }
3089 ]
3090 },
3091 {
3092 "id": "nested-any-of-in-any-of-kept",
3093 "description": "A composition nested inside a composition is normalized branch by branch.",
3094 "schema": {
3095 "type": "object",
3096 "properties": {
3097 "v": {
3098 "anyOf": [
3099 {
3100 "anyOf": [
3101 {
3102 "type": "object",
3103 "properties": {
3104 "a": {
3105 "type": "string"
3106 }
3107 }
3108 },
3109 {
3110 "type": "number"
3111 }
3112 ]
3113 },
3114 {
3115 "type": "string"
3116 }
3117 ]
3118 }
3119 },
3120 "required": ["v"]
3121 },
3122 "strict": {
3123 "schema": {
3124 "type": "object",
3125 "properties": {
3126 "v": {
3127 "anyOf": [
3128 {
3129 "anyOf": [
3130 {
3131 "type": "object",
3132 "properties": {
3133 "a": {
3134 "type": ["string", "null"]
3135 }
3136 },
3137 "required": ["a"],
3138 "additionalProperties": false
3139 },
3140 {
3141 "type": "number"
3142 }
3143 ]
3144 },
3145 {
3146 "type": "string"
3147 }
3148 ]
3149 }
3150 },
3151 "required": ["v"],
3152 "additionalProperties": false
3153 }
3154 },
3155 "changes": [
3156 {
3157 "path": "properties.v.anyOf[0].anyOf[0].properties.a",
3158 "reason": "optional-property-nullable"
3159 }
3160 ],
3161 "arguments": [
3162 {
3163 "input": {
3164 "v": {
3165 "a": null
3166 }
3167 },
3168 "output": {
3169 "v": {}
3170 }
3171 }
3172 ]
3173 },
3174 {
3175 "id": "definitions-and-defs-both-normalized",
3176 "description": "Legacy definitions and $defs coexist and both are normalized.",
3177 "schema": {
3178 "type": "object",
3179 "properties": {
3180 "a": {
3181 "$ref": "#/$defs/A"
3182 },
3183 "b": {
3184 "$ref": "#/definitions/B"
3185 }
3186 },
3187 "required": ["a", "b"],
3188 "$defs": {
3189 "A": {
3190 "type": "object",
3191 "properties": {
3192 "x": {
3193 "type": "string"
3194 }
3195 }
3196 }
3197 },
3198 "definitions": {
3199 "B": {
3200 "type": "object",
3201 "properties": {
3202 "y": {
3203 "type": "string"
3204 }
3205 }
3206 }
3207 }
3208 },
3209 "strict": {
3210 "schema": {
3211 "type": "object",
3212 "properties": {
3213 "a": {
3214 "$ref": "#/$defs/A"
3215 },
3216 "b": {
3217 "$ref": "#/definitions/B"
3218 }
3219 },
3220 "required": ["a", "b"],
3221 "$defs": {
3222 "A": {
3223 "type": "object",
3224 "properties": {
3225 "x": {
3226 "type": ["string", "null"]
3227 }
3228 },
3229 "required": ["x"],
3230 "additionalProperties": false
3231 }
3232 },
3233 "definitions": {
3234 "B": {
3235 "type": "object",
3236 "properties": {
3237 "y": {
3238 "type": ["string", "null"]
3239 }
3240 },
3241 "required": ["y"],
3242 "additionalProperties": false
3243 }
3244 },
3245 "additionalProperties": false
3246 }
3247 },
3248 "changes": [
3249 {
3250 "path": "$defs.A.properties.x",
3251 "reason": "optional-property-nullable"
3252 },
3253 {
3254 "path": "definitions.B.properties.y",
3255 "reason": "optional-property-nullable"
3256 }
3257 ]
3258 },
3259 {
3260 "id": "deep-nesting-normalized-fully",
3261 "description": "Ten levels of nested objects are normalized at every level.",
3262 "schema": {
3263 "type": "object",
3264 "properties": {
3265 "child": {
3266 "type": "object",
3267 "properties": {
3268 "child": {
3269 "type": "object",
3270 "properties": {
3271 "child": {
3272 "type": "object",
3273 "properties": {
3274 "child": {
3275 "type": "object",
3276 "properties": {
3277 "child": {
3278 "type": "object",
3279 "properties": {
3280 "child": {
3281 "type": "object",
3282 "properties": {
3283 "child": {
3284 "type": "object",
3285 "properties": {
3286 "child": {
3287 "type": "object",
3288 "properties": {
3289 "child": {
3290 "type": "object",
3291 "properties": {
3292 "child": {
3293 "type": "object",
3294 "properties": {
3295 "leaf": {
3296 "type": "string"
3297 }
3298 }
3299 }
3300 },
3301 "required": ["child"]
3302 }
3303 },
3304 "required": ["child"]
3305 }
3306 },
3307 "required": ["child"]
3308 }
3309 },
3310 "required": ["child"]
3311 }
3312 },
3313 "required": ["child"]
3314 }
3315 },
3316 "required": ["child"]
3317 }
3318 },
3319 "required": ["child"]
3320 }
3321 },
3322 "required": ["child"]
3323 }
3324 },
3325 "required": ["child"]
3326 }
3327 },
3328 "required": ["child"]
3329 },
3330 "strict": {
3331 "schema": {
3332 "type": "object",
3333 "properties": {
3334 "child": {
3335 "type": "object",
3336 "properties": {
3337 "child": {
3338 "type": "object",
3339 "properties": {
3340 "child": {
3341 "type": "object",
3342 "properties": {
3343 "child": {
3344 "type": "object",
3345 "properties": {
3346 "child": {
3347 "type": "object",
3348 "properties": {
3349 "child": {
3350 "type": "object",
3351 "properties": {
3352 "child": {
3353 "type": "object",
3354 "properties": {
3355 "child": {
3356 "type": "object",
3357 "properties": {
3358 "child": {
3359 "type": "object",
3360 "properties": {
3361 "child": {
3362 "type": "object",
3363 "properties": {
3364 "leaf": {
3365 "type": ["string", "null"]
3366 }
3367 },
3368 "required": ["leaf"],
3369 "additionalProperties": false
3370 }
3371 },
3372 "required": ["child"],
3373 "additionalProperties": false
3374 }
3375 },
3376 "required": ["child"],
3377 "additionalProperties": false
3378 }
3379 },
3380 "required": ["child"],
3381 "additionalProperties": false
3382 }
3383 },
3384 "required": ["child"],
3385 "additionalProperties": false
3386 }
3387 },
3388 "required": ["child"],
3389 "additionalProperties": false
3390 }
3391 },
3392 "required": ["child"],
3393 "additionalProperties": false
3394 }
3395 },
3396 "required": ["child"],
3397 "additionalProperties": false
3398 }
3399 },
3400 "required": ["child"],
3401 "additionalProperties": false
3402 }
3403 },
3404 "required": ["child"],
3405 "additionalProperties": false
3406 }
3407 },
3408 "required": ["child"],
3409 "additionalProperties": false
3410 }
3411 },
3412 "changes": [
3413 {
3414 "path": "properties.child.properties.child.properties.child.properties.child.properties.child.properties.child.properties.child.properties.child.properties.child.properties.child.properties.leaf",
3415 "reason": "optional-property-nullable"
3416 }
3417 ]
3418 },
3419 {
3420 "id": "chained-refs-resolved",
3421 "description": "A $ref to a $ref resolves to the final definition.",
3422 "schema": {
3423 "type": "object",
3424 "properties": {
3425 "a": {
3426 "$ref": "#/$defs/Alias"
3427 }
3428 },
3429 "required": ["a"],
3430 "$defs": {
3431 "Alias": {
3432 "$ref": "#/$defs/Real"
3433 },
3434 "Real": {
3435 "type": "object",
3436 "properties": {
3437 "x": {
3438 "type": "string"
3439 }
3440 },
3441 "required": ["x"]
3442 }
3443 }
3444 },
3445 "strict": {
3446 "schema": {
3447 "type": "object",
3448 "properties": {
3449 "a": {
3450 "$ref": "#/$defs/Alias"
3451 }
3452 },
3453 "required": ["a"],
3454 "$defs": {
3455 "Alias": {
3456 "$ref": "#/$defs/Real"
3457 },
3458 "Real": {
3459 "type": "object",
3460 "properties": {
3461 "x": {
3462 "type": "string"
3463 }
3464 },
3465 "required": ["x"],
3466 "additionalProperties": false
3467 }
3468 },
3469 "additionalProperties": false
3470 }
3471 },
3472 "arguments": [
3473 {
3474 "input": {
3475 "a": {
3476 "x": null
3477 }
3478 },
3479 "output": {
3480 "a": {}
3481 }
3482 },
3483 {
3484 "input": {
3485 "a": null
3486 },
3487 "output": {}
3488 }
3489 ]
3490 },
3491 {
3492 "id": "optional-typed-enum-wrapped",
3493 "description": "A typed enum is wrapped whole: adding null to its type would leave the enum rejecting it.",
3494 "schema": {
3495 "type": "object",
3496 "properties": {
3497 "direction": {
3498 "type": "string",
3499 "enum": ["asc", "desc"],
3500 "description": "sort order"
3501 }
3502 }
3503 },
3504 "strict": {
3505 "schema": {
3506 "type": "object",
3507 "properties": {
3508 "direction": {
3509 "description": "sort order",
3510 "anyOf": [
3511 {
3512 "type": "string",
3513 "enum": ["asc", "desc"]
3514 },
3515 {
3516 "type": "null"
3517 }
3518 ]
3519 }
3520 },
3521 "required": ["direction"],
3522 "additionalProperties": false
3523 }
3524 },
3525 "changes": [
3526 {
3527 "path": "properties.direction",
3528 "reason": "optional-property-nullable"
3529 }
3530 ],
3531 "arguments": [
3532 {
3533 "input": {
3534 "direction": null
3535 },
3536 "output": {}
3537 },
3538 {
3539 "input": {
3540 "direction": "asc"
3541 },
3542 "output": {
3543 "direction": "asc"
3544 }
3545 }
3546 ]
3547 },
3548 {
3549 "id": "optional-nullable-typed-enum-wrapped",
3550 "description": "A null in `type` does not make an enum without null nullable.",
3551 "schema": {
3552 "type": "object",
3553 "properties": {
3554 "direction": {
3555 "type": ["string", "null"],
3556 "enum": ["asc", "desc"]
3557 }
3558 }
3559 },
3560 "strict": {
3561 "schema": {
3562 "type": "object",
3563 "properties": {
3564 "direction": {
3565 "anyOf": [
3566 {
3567 "type": ["string", "null"],
3568 "enum": ["asc", "desc"]
3569 },
3570 {
3571 "type": "null"
3572 }
3573 ]
3574 }
3575 },
3576 "required": ["direction"],
3577 "additionalProperties": false
3578 }
3579 },
3580 "changes": [
3581 {
3582 "path": "properties.direction",
3583 "reason": "optional-property-nullable"
3584 }
3585 ],
3586 "arguments": [
3587 {
3588 "input": {
3589 "direction": null
3590 },
3591 "output": {}
3592 }
3593 ]
3594 },
3595 {
3596 "id": "optional-typed-const-wrapped",
3597 "description": "A typed const is wrapped whole, like a typed enum.",
3598 "schema": {
3599 "type": "object",
3600 "properties": {
3601 "mode": {
3602 "type": "string",
3603 "const": "asc"
3604 }
3605 }
3606 },
3607 "strict": {
3608 "schema": {
3609 "type": "object",
3610 "properties": {
3611 "mode": {
3612 "anyOf": [
3613 {
3614 "type": "string",
3615 "const": "asc"
3616 },
3617 {
3618 "type": "null"
3619 }
3620 ]
3621 }
3622 },
3623 "required": ["mode"],
3624 "additionalProperties": false
3625 }
3626 },
3627 "changes": [
3628 {
3629 "path": "properties.mode",
3630 "reason": "optional-property-nullable"
3631 }
3632 ],
3633 "arguments": [
3634 {
3635 "input": {
3636 "mode": null
3637 },
3638 "output": {}
3639 }
3640 ]
3641 },
3642 {
3643 "id": "optional-typed-enum-with-null-unchanged",
3644 "description": "A typed enum that lists null under a nullable type already accepts null.",
3645 "schema": {
3646 "type": "object",
3647 "properties": {
3648 "direction": {
3649 "type": ["string", "null"],
3650 "enum": ["asc", null]
3651 }
3652 }
3653 },
3654 "strict": {
3655 "schema": {
3656 "type": "object",
3657 "properties": {
3658 "direction": {
3659 "type": ["string", "null"],
3660 "enum": ["asc", null]
3661 }
3662 },
3663 "required": ["direction"],
3664 "additionalProperties": false
3665 }
3666 },
3667 "changes": [
3668 {
3669 "path": "properties.direction",
3670 "reason": "optional-property-nullable"
3671 }
3672 ],
3673 "arguments": [
3674 {
3675 "input": {
3676 "direction": null
3677 },
3678 "output": {
3679 "direction": null
3680 }
3681 }
3682 ]
3683 },
3684 {
3685 "id": "optional-any-of-with-sibling-enum-wrapped",
3686 "description": "A null branch in anyOf does not lift a sibling enum, so the node is wrapped.",
3687 "schema": {
3688 "type": "object",
3689 "properties": {
3690 "direction": {
3691 "enum": ["asc", "desc"],
3692 "anyOf": [
3693 {
3694 "type": "string"
3695 },
3696 {
3697 "type": "null"
3698 }
3699 ]
3700 }
3701 }
3702 },
3703 "strict": {
3704 "schema": {
3705 "type": "object",
3706 "properties": {
3707 "direction": {
3708 "anyOf": [
3709 {
3710 "enum": ["asc", "desc"],
3711 "anyOf": [
3712 {
3713 "type": "string"
3714 },
3715 {
3716 "type": "null"
3717 }
3718 ]
3719 },
3720 {
3721 "type": "null"
3722 }
3723 ]
3724 }
3725 },
3726 "required": ["direction"],
3727 "additionalProperties": false
3728 }
3729 },
3730 "changes": [
3731 {
3732 "path": "properties.direction",
3733 "reason": "optional-property-nullable"
3734 }
3735 ],
3736 "arguments": [
3737 {
3738 "input": {
3739 "direction": null
3740 },
3741 "output": {}
3742 }
3743 ]
3744 },
3745 {
3746 "id": "optional-ref-with-sibling-type-wrapped",
3747 "description": "Keywords beside a $ref apply together with its target.",
3748 "schema": {
3749 "type": "object",
3750 "properties": {
3751 "direction": {
3752 "$ref": "#/$defs/Direction",
3753 "type": "string"
3754 }
3755 },
3756 "$defs": {
3757 "Direction": {
3758 "enum": ["asc", null]
3759 }
3760 }
3761 },
3762 "strict": {
3763 "schema": {
3764 "type": "object",
3765 "properties": {
3766 "direction": {
3767 "anyOf": [
3768 {
3769 "$ref": "#/$defs/Direction",
3770 "type": "string"
3771 },
3772 {
3773 "type": "null"
3774 }
3775 ]
3776 }
3777 },
3778 "$defs": {
3779 "Direction": {
3780 "enum": ["asc", null]
3781 }
3782 },
3783 "required": ["direction"],
3784 "additionalProperties": false
3785 }
3786 },
3787 "changes": [
3788 {
3789 "path": "properties.direction",
3790 "reason": "optional-property-nullable"
3791 }
3792 ],
3793 "arguments": [
3794 {
3795 "input": {
3796 "direction": null
3797 },
3798 "output": {}
3799 }
3800 ]
3801 },
3802 {
3803 "id": "optional-ref-to-nullable-definition-unchanged",
3804 "description": "A $ref whose target accepts null needs no extra null branch.",
3805 "schema": {
3806 "type": "object",
3807 "properties": {
3808 "note": {
3809 "$ref": "#/$defs/Note"
3810 }
3811 },
3812 "$defs": {
3813 "Note": {
3814 "type": ["string", "null"]
3815 }
3816 }
3817 },
3818 "strict": {
3819 "schema": {
3820 "type": "object",
3821 "properties": {
3822 "note": {
3823 "$ref": "#/$defs/Note"
3824 }
3825 },
3826 "$defs": {
3827 "Note": {
3828 "type": ["string", "null"]
3829 }
3830 },
3831 "required": ["note"],
3832 "additionalProperties": false
3833 }
3834 },
3835 "changes": [
3836 {
3837 "path": "properties.note",
3838 "reason": "optional-property-nullable"
3839 }
3840 ],
3841 "arguments": [
3842 {
3843 "input": {
3844 "note": null
3845 },
3846 "output": {
3847 "note": null
3848 }
3849 }
3850 ]
3851 },
3852 {
3853 "id": "optional-ref-to-typeless-object-wrapped",
3854 "description": "A definition with properties but no type is typed as an object by the rewrite, so a $ref to it needs a null branch.",
3855 "schema": {
3856 "type": "object",
3857 "properties": {
3858 "cfg": {
3859 "$ref": "#/$defs/Config"
3860 }
3861 },
3862 "$defs": {
3863 "Config": {
3864 "properties": {
3865 "url": {
3866 "type": "string"
3867 }
3868 },
3869 "required": ["url"]
3870 }
3871 }
3872 },
3873 "strict": {
3874 "schema": {
3875 "type": "object",
3876 "properties": {
3877 "cfg": {
3878 "anyOf": [
3879 {
3880 "$ref": "#/$defs/Config"
3881 },
3882 {
3883 "type": "null"
3884 }
3885 ]
3886 }
3887 },
3888 "$defs": {
3889 "Config": {
3890 "properties": {
3891 "url": {
3892 "type": "string"
3893 }
3894 },
3895 "required": ["url"],
3896 "type": "object",
3897 "additionalProperties": false
3898 }
3899 },
3900 "required": ["cfg"],
3901 "additionalProperties": false
3902 }
3903 },
3904 "changes": [
3905 {
3906 "path": "properties.cfg",
3907 "reason": "optional-property-nullable"
3908 }
3909 ],
3910 "arguments": [
3911 {
3912 "input": {
3913 "cfg": null
3914 },
3915 "output": {
3916 "cfg": null
3917 }
3918 },
3919 {
3920 "input": {
3921 "cfg": {
3922 "url": "u"
3923 }
3924 },
3925 "output": {
3926 "cfg": {
3927 "url": "u"
3928 }
3929 }
3930 }
3931 ]
3932 },
3933 {
3934 "id": "ref-into-wrapped-property-unsupported",
3935 "description": "Wrapping a property moves what is nested in it; a $ref into it would dangle.",
3936 "schema": {
3937 "type": "object",
3938 "properties": {
3939 "value": {
3940 "type": "string",
3941 "enum": ["asc"],
3942 "$defs": {
3943 "Text": {
3944 "type": "string"
3945 }
3946 }
3947 },
3948 "alias": {
3949 "$ref": "#/properties/value/$defs/Text"
3950 }
3951 },
3952 "required": ["alias"]
3953 },
3954 "strict": {
3955 "unsupported": [
3956 {
3957 "path": "properties.alias",
3958 "keyword": "$ref"
3959 }
3960 ]
3961 },
3962 "changes": [
3963 {
3964 "path": "properties.value",
3965 "reason": "optional-property-nullable"
3966 }
3967 ]
3968 }
3969 ]
3970 }