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

next
json 1,173 lines 39.9 KB
Raw
1 {
2 "cases": [
3 {
4 "id": "nested-free-form-object",
5 "description": "A nested `{ type: \"object\" }` property must accept and preserve arbitrary content (issue #4064, METABASE_POST_API_CARD.dataset_query).",
6 "schema": {
7 "type": "object",
8 "properties": { "dataset_query": { "type": "object" } }
9 },
10 "ingress": {
11 "accepted": true,
12 "preserved": {
13 "type": "object",
14 "properties": { "dataset_query": { "type": "object" } }
15 }
16 },
17 "instances": [
18 {
19 "input": { "dataset_query": { "database": 1, "query": { "source-table": 2 } } },
20 "accepted": true,
21 "zod": {
22 "output": { "dataset_query": { "database": 1, "query": { "source-table": 2 } } }
23 },
24 "effect": {
25 "output": { "dataset_query": { "database": 1, "query": { "source-table": 2 } } }
26 },
27 "python": {
28 "output": { "dataset_query": { "database": 1, "query": { "source-table": 2 } } }
29 }
30 }
31 ]
32 },
33 {
34 "id": "root-free-form-absent-properties",
35 "description": "A root object with no `properties` member and omitted `additionalProperties` is open.",
36 "schema": { "type": "object" },
37 "ingress": {
38 "accepted": true,
39 "preserved": { "type": "object" }
40 },
41 "instances": [
42 {
43 "input": { "anything": { "a": 1 }, "other": "x" },
44 "accepted": true,
45 "zod": { "output": { "anything": { "a": 1 }, "other": "x" } },
46 "effect": { "output": { "anything": { "a": 1 }, "other": "x" } },
47 "python": { "output": { "anything": { "a": 1 }, "other": "x" } }
48 }
49 ]
50 },
51 {
52 "id": "root-free-form-empty-properties",
53 "description": "`properties: {}` is property-less too, and stays open when `additionalProperties` is omitted.",
54 "schema": { "type": "object", "properties": {} },
55 "ingress": {
56 "accepted": true,
57 "preserved": { "type": "object", "properties": {} }
58 },
59 "instances": [
60 {
61 "input": { "foo": 1, "bar": { "baz": true } },
62 "accepted": true,
63 "zod": { "output": { "foo": 1, "bar": { "baz": true } } },
64 "effect": { "output": { "foo": 1, "bar": { "baz": true } } },
65 "python": { "output": { "foo": 1, "bar": { "baz": true } } }
66 }
67 ]
68 },
69 {
70 "id": "free-form-object-in-array-items",
71 "description": "Property-less objects placed as array items preserve arbitrary content.",
72 "schema": {
73 "type": "object",
74 "properties": {
75 "records": { "type": "array", "items": { "type": "object" } }
76 }
77 },
78 "ingress": {
79 "accepted": true,
80 "preserved": {
81 "type": "object",
82 "properties": {
83 "records": { "type": "array", "items": { "type": "object" } }
84 }
85 }
86 },
87 "instances": [
88 {
89 "input": { "records": [{ "a": 1 }, { "b": { "c": 2 } }] },
90 "accepted": true,
91 "zod": { "output": { "records": [{ "a": 1 }, { "b": { "c": 2 } }] } },
92 "effect": { "output": { "records": [{ "a": 1 }, { "b": { "c": 2 } }] } },
93 "python": { "output": { "records": [{ "a": 1 }, { "b": { "c": 2 } }] } }
94 }
95 ]
96 },
97 {
98 "id": "nested-pattern-properties-object",
99 "description": "A dynamic-key policy nested under a declared property validates and preserves matching keys.",
100 "schema": {
101 "type": "object",
102 "properties": {
103 "payload": {
104 "type": "object",
105 "patternProperties": { "^count_": { "type": "integer" } },
106 "additionalProperties": false
107 }
108 },
109 "required": ["payload"]
110 },
111 "ingress": {
112 "accepted": true,
113 "preserved": {
114 "type": "object",
115 "properties": {
116 "payload": {
117 "type": "object",
118 "patternProperties": { "^count_": { "type": "integer" } },
119 "additionalProperties": false
120 }
121 },
122 "required": ["payload"]
123 }
124 },
125 "instances": [
126 {
127 "input": { "payload": { "count_a": 1 } },
128 "accepted": true,
129 "zod": { "output": { "payload": { "count_a": 1 } } },
130 "effect": { "output": { "payload": { "count_a": 1 } } },
131 "python": { "output": { "payload": { "count_a": 1 } } }
132 },
133 {
134 "input": { "payload": { "count_a": "1" } },
135 "accepted": false
136 },
137 {
138 "input": { "payload": { "other": 1 } },
139 "accepted": false
140 }
141 ]
142 },
143 {
144 "id": "schema-valued-additional-properties-in-array-items",
145 "description": "A schema-valued dynamic-key policy inside array items validates every preserved value.",
146 "schema": {
147 "type": "object",
148 "properties": {
149 "records": {
150 "type": "array",
151 "items": {
152 "type": "object",
153 "additionalProperties": { "type": "number" }
154 }
155 }
156 },
157 "required": ["records"]
158 },
159 "ingress": {
160 "accepted": true,
161 "preserved": {
162 "type": "object",
163 "properties": {
164 "records": {
165 "type": "array",
166 "items": {
167 "type": "object",
168 "additionalProperties": { "type": "number" }
169 }
170 }
171 },
172 "required": ["records"]
173 }
174 },
175 "instances": [
176 {
177 "input": { "records": [{ "a": 1 }, { "b": 2.5 }] },
178 "accepted": true,
179 "zod": { "output": { "records": [{ "a": 1 }, { "b": 2.5 }] } },
180 "effect": { "output": { "records": [{ "a": 1 }, { "b": 2.5 }] } },
181 "python": { "output": { "records": [{ "a": 1 }, { "b": 2.5 }] } }
182 },
183 {
184 "input": { "records": [{ "a": "1" }] },
185 "accepted": false
186 }
187 ]
188 },
189 {
190 "id": "explicit-additional-properties-false",
191 "description": "An explicit `additionalProperties: false` closes an otherwise property-less object.",
192 "schema": { "type": "object", "properties": {}, "additionalProperties": false },
193 "ingress": {
194 "accepted": true,
195 "preserved": { "type": "object", "properties": {}, "additionalProperties": false }
196 },
197 "instances": [
198 {
199 "input": {},
200 "accepted": true,
201 "zod": { "output": {} },
202 "effect": { "output": {} },
203 "python": { "output": {} }
204 },
205 {
206 "input": { "foo": 1 },
207 "accepted": false
208 }
209 ]
210 },
211 {
212 "id": "explicit-additional-properties-true",
213 "description": "An explicit `additionalProperties: true` preserves unknown keys alongside named properties.",
214 "schema": {
215 "type": "object",
216 "properties": { "name": { "type": "string" } },
217 "additionalProperties": true
218 },
219 "ingress": {
220 "accepted": true,
221 "preserved": {
222 "type": "object",
223 "properties": { "name": { "type": "string" } },
224 "additionalProperties": true
225 }
226 },
227 "instances": [
228 {
229 "input": { "name": "a", "extra": 1 },
230 "accepted": true,
231 "zod": { "output": { "name": "a", "extra": 1 } },
232 "effect": { "output": { "name": "a", "extra": 1 } },
233 "python": { "output": { "name": "a", "extra": 1 } }
234 }
235 ]
236 },
237 {
238 "id": "named-properties-strict-by-default",
239 "description": "Composio divergence: named `properties` with omitted `additionalProperties` stay strict for tool inputs, while JSON Schema itself would allow unknown keys.",
240 "divergesFromJsonSchema": "JSON Schema treats omitted `additionalProperties` as permissive; Composio tool inputs keep it strict.",
241 "schema": {
242 "type": "object",
243 "properties": { "name": { "type": "string" } },
244 "required": ["name"]
245 },
246 "ingress": {
247 "accepted": true,
248 "preserved": {
249 "type": "object",
250 "properties": { "name": { "type": "string" } },
251 "required": ["name"]
252 }
253 },
254 "instances": [
255 {
256 "input": { "name": "a" },
257 "accepted": true,
258 "zod": { "output": { "name": "a" } },
259 "effect": { "output": { "name": "a" } },
260 "python": { "output": { "name": "a" } }
261 },
262 {
263 "input": { "name": "a", "extra": 1 },
264 "accepted": false
265 }
266 ]
267 },
268 {
269 "id": "named-properties-with-pattern-properties",
270 "description": "With named `properties` plus `patternProperties` and omitted `additionalProperties`, pattern-matching keys are admitted and validated while other unknown keys stay rejected.",
271 "divergesFromJsonSchema": "JSON Schema treats omitted `additionalProperties` as permissive; Composio tool inputs keep it strict.",
272 "schema": {
273 "type": "object",
274 "properties": { "name": { "type": "string" } },
275 "patternProperties": { "^x-": { "type": "number" } }
276 },
277 "ingress": {
278 "accepted": true,
279 "preserved": {
280 "type": "object",
281 "properties": { "name": { "type": "string" } },
282 "patternProperties": { "^x-": { "type": "number" } }
283 }
284 },
285 "instances": [
286 {
287 "input": { "name": "a", "x-count": 3 },
288 "accepted": true,
289 "zod": { "output": { "name": "a", "x-count": 3 } },
290 "effect": { "output": { "name": "a", "x-count": 3 } },
291 "python": { "output": { "name": "a", "x-count": 3 } }
292 },
293 {
294 "input": { "name": "a", "x-count": "nope" },
295 "accepted": false
296 },
297 {
298 "input": { "name": "a", "other": 1 },
299 "accepted": false
300 }
301 ]
302 },
303 {
304 "id": "root-additional-properties-schema-valued",
305 "description": "A schema-valued root `additionalProperties` survives `ToolSchema.parse` and validates unknown keys.",
306 "schema": {
307 "type": "object",
308 "properties": { "name": { "type": "string" } },
309 "additionalProperties": { "type": "number" }
310 },
311 "ingress": {
312 "accepted": true,
313 "preserved": {
314 "type": "object",
315 "properties": { "name": { "type": "string" } },
316 "additionalProperties": { "type": "number" }
317 }
318 },
319 "instances": [
320 {
321 "input": { "name": "a", "count": 2 },
322 "accepted": true,
323 "zod": { "output": { "name": "a", "count": 2 } },
324 "effect": { "output": { "name": "a", "count": 2 } },
325 "python": { "output": { "name": "a", "count": 2 } }
326 },
327 {
328 "input": { "name": "a", "count": "x" },
329 "accepted": false
330 }
331 ]
332 },
333 {
334 "id": "pattern-only-object",
335 "description": "A pattern-only object with no named `properties` accepts unmatched keys while still validating matched ones.",
336 "schema": {
337 "type": "object",
338 "patternProperties": { "^s_": { "type": "string" } }
339 },
340 "instances": [
341 {
342 "input": { "s_a": "x", "other": 1 },
343 "accepted": true,
344 "zod": { "output": { "s_a": "x", "other": 1 } },
345 "effect": { "output": { "s_a": "x", "other": 1 } },
346 "python": { "output": { "s_a": "x", "other": 1 } }
347 },
348 {
349 "input": { "s_a": 5 },
350 "accepted": false
351 }
352 ]
353 },
354 {
355 "id": "multiple-matching-patterns",
356 "description": "A key matching several non-transforming patterns must satisfy all of them.",
357 "schema": {
358 "type": "object",
359 "patternProperties": {
360 "^a": { "type": "string" },
361 "b$": { "type": "string", "minLength": 2 }
362 }
363 },
364 "instances": [
365 {
366 "input": { "ab": "xy" },
367 "accepted": true,
368 "zod": { "output": { "ab": "xy" } },
369 "effect": { "output": { "ab": "xy" } },
370 "python": { "output": { "ab": "xy" } }
371 },
372 {
373 "input": { "ab": "x" },
374 "accepted": false
375 },
376 {
377 "input": { "ab": 5 },
378 "accepted": false
379 }
380 ]
381 },
382 {
383 "id": "declared-property-also-matching-a-pattern",
384 "description": "A key declared in `properties` is still checked against every matching pattern.",
385 "schema": {
386 "type": "object",
387 "properties": { "x_id": { "type": "string" } },
388 "patternProperties": { "^x_": { "type": "string", "minLength": 3 } }
389 },
390 "ingress": {
391 "accepted": true,
392 "preserved": {
393 "type": "object",
394 "properties": { "x_id": { "type": "string" } },
395 "patternProperties": { "^x_": { "type": "string", "minLength": 3 } }
396 }
397 },
398 "instances": [
399 {
400 "input": { "x_id": "abc" },
401 "accepted": true,
402 "zod": { "output": { "x_id": "abc" } },
403 "effect": { "output": { "x_id": "abc" } },
404 "python": { "output": { "x_id": "abc" } }
405 },
406 {
407 "input": { "x_id": "ab" },
408 "accepted": false
409 }
410 ]
411 },
412 {
413 "id": "schema-valued-additional-applies-only-to-unmatched-keys",
414 "description": "Schema-valued `additionalProperties` must not rescue a key that a `patternProperties` entry already claims and rejects.",
415 "schema": {
416 "type": "object",
417 "properties": { "name": { "type": "string" } },
418 "patternProperties": { "^n_": { "type": "number" } },
419 "additionalProperties": { "type": "boolean" }
420 },
421 "ingress": {
422 "accepted": true,
423 "preserved": {
424 "type": "object",
425 "properties": { "name": { "type": "string" } },
426 "patternProperties": { "^n_": { "type": "number" } },
427 "additionalProperties": { "type": "boolean" }
428 }
429 },
430 "instances": [
431 {
432 "input": { "name": "a", "n_x": 1, "flag": true },
433 "accepted": true,
434 "zod": { "output": { "name": "a", "n_x": 1, "flag": true } },
435 "effect": { "output": { "name": "a", "n_x": 1, "flag": true } },
436 "python": { "output": { "name": "a", "n_x": 1, "flag": true } }
437 },
438 {
439 "input": { "name": "a", "n_x": true },
440 "accepted": false
441 },
442 {
443 "input": { "name": "a", "flag": 1 },
444 "accepted": false
445 }
446 ]
447 },
448 {
449 "id": "empty-schema-additional-properties",
450 "description": "An empty schema accepts every unmatched value without coercing or discarding it.",
451 "schema": {
452 "type": "object",
453 "properties": { "name": { "type": "string" } },
454 "additionalProperties": {}
455 },
456 "instances": [
457 {
458 "input": { "name": "a", "count": 1, "metadata": { "active": true } },
459 "accepted": true,
460 "zod": {
461 "output": { "name": "a", "count": 1, "metadata": { "active": true } }
462 },
463 "effect": {
464 "output": { "name": "a", "count": 1, "metadata": { "active": true } }
465 },
466 "python": {
467 "output": { "name": "a", "count": 1, "metadata": { "active": true } }
468 }
469 }
470 ]
471 },
472 {
473 "id": "pattern-property-enum",
474 "description": "A matching dynamic key must satisfy an enum-only schema with no explicit type.",
475 "schema": {
476 "type": "object",
477 "patternProperties": { "^status_": { "enum": ["ready", "done"] } }
478 },
479 "instances": [
480 {
481 "input": { "status_job": "ready" },
482 "accepted": true,
483 "zod": { "output": { "status_job": "ready" } },
484 "effect": { "output": { "status_job": "ready" } },
485 "python": { "output": { "status_job": "ready" } }
486 },
487 {
488 "input": { "status_job": "blocked" },
489 "accepted": false
490 }
491 ]
492 },
493 {
494 "id": "pattern-property-strict-nested-array",
495 "description": "Nested container values are validated without coercing strings into integers.",
496 "schema": {
497 "type": "object",
498 "patternProperties": {
499 "^batch_": {
500 "type": "object",
501 "properties": {
502 "values": { "type": "array", "items": { "type": "integer" } }
503 },
504 "required": ["values"],
505 "additionalProperties": false
506 }
507 }
508 },
509 "instances": [
510 {
511 "input": { "batch_a": { "values": [1, 2] } },
512 "accepted": true,
513 "zod": { "output": { "batch_a": { "values": [1, 2] } } },
514 "effect": { "output": { "batch_a": { "values": [1, 2] } } },
515 "python": { "output": { "batch_a": { "values": [1, 2] } } }
516 },
517 {
518 "input": { "batch_a": { "values": ["1"] } },
519 "accepted": false
520 }
521 ]
522 },
523 {
524 "id": "false-pattern-property-schema",
525 "description": "A boolean-false pattern schema rejects every value for matching keys.",
526 "schema": {
527 "type": "object",
528 "patternProperties": { "^forbidden$": false }
529 },
530 "instances": [
531 {
532 "input": { "other": 1 },
533 "accepted": true,
534 "zod": { "output": { "other": 1 } },
535 "effect": { "output": { "other": 1 } },
536 "python": { "output": { "other": 1 } }
537 },
538 {
539 "input": { "forbidden": null },
540 "accepted": false
541 }
542 ]
543 },
544 {
545 "id": "pattern-property-type-union",
546 "description": "A list-valued type accepts only the listed JSON instance types.",
547 "schema": {
548 "type": "object",
549 "patternProperties": { "^value_": { "type": ["string", "null"] } }
550 },
551 "instances": [
552 {
553 "input": { "value_a": "text", "value_b": null },
554 "accepted": true,
555 "zod": { "output": { "value_a": "text", "value_b": null } },
556 "effect": { "output": { "value_a": "text", "value_b": null } },
557 "python": { "output": { "value_a": "text", "value_b": null } }
558 },
559 {
560 "input": { "value_a": 1 },
561 "accepted": false
562 }
563 ]
564 },
565 {
566 "id": "pattern-property-json-integer",
567 "description": "A mathematically integral JSON number satisfies the integer type even when decoded as a float.",
568 "schema": {
569 "type": "object",
570 "patternProperties": { "^count_": { "type": "integer" } }
571 },
572 "instances": [
573 {
574 "input": { "count_a": 1.0 },
575 "accepted": true,
576 "zod": { "output": { "count_a": 1.0 } },
577 "effect": { "output": { "count_a": 1.0 } },
578 "python": { "output": { "count_a": 1.0 } }
579 },
580 {
581 "input": { "count_a": 1.5 },
582 "accepted": false
583 }
584 ]
585 },
586 {
587 "id": "pattern-property-composed-const-exclusion",
588 "description": "Composed dynamic-key schemas retain const and not semantics.",
589 "schema": {
590 "type": "object",
591 "patternProperties": {
592 "^label_": {
593 "allOf": [{ "type": "string" }, { "not": { "const": "blocked" } }]
594 }
595 }
596 },
597 "instances": [
598 {
599 "input": { "label_job": "ready" },
600 "accepted": true,
601 "zod": { "output": { "label_job": "ready" } },
602 "effect": { "output": { "label_job": "ready" } },
603 "python": { "output": { "label_job": "ready" } }
604 },
605 {
606 "input": { "label_job": "blocked" },
607 "accepted": false
608 }
609 ]
610 },
611 {
612 "id": "pattern-property-default-materialization",
613 "description": "Composio divergence: Zod and Pydantic materialize `default` inside a matching pattern schema, while Effect decoding is validation-only and returns the input unchanged.",
614 "divergesFromJsonSchema": "`default` is annotation-only in JSON Schema; the Zod and Pydantic converters materialize it.",
615 "schema": {
616 "type": "object",
617 "properties": {},
618 "patternProperties": {
619 "^p_": {
620 "type": "object",
621 "properties": { "mode": { "type": "string", "default": "auto" } }
622 }
623 }
624 },
625 "ingress": {
626 "accepted": true,
627 "preserved": {
628 "type": "object",
629 "properties": {},
630 "patternProperties": {
631 "^p_": {
632 "type": "object",
633 "properties": { "mode": { "type": "string", "default": "auto" } }
634 }
635 }
636 }
637 },
638 "instances": [
639 {
640 "input": { "p_a": {} },
641 "accepted": true,
642 "zod": { "output": { "p_a": { "mode": "auto" } } },
643 "effect": { "output": { "p_a": {} } },
644 "python": { "output": { "p_a": { "mode": "auto" } } }
645 }
646 ]
647 },
648 {
649 "id": "primitive-boolean-property-schemas",
650 "description": "Boolean property schemas accept every value for true and reject every supplied value for false.",
651 "schema": {
652 "type": "object",
653 "properties": { "allowed": true, "forbidden": false },
654 "required": ["allowed"]
655 },
656 "instances": [
657 { "input": { "allowed": { "nested": 1 } }, "accepted": true },
658 { "input": { "allowed": 42, "forbidden": "present" }, "accepted": false }
659 ]
660 },
661 {
662 "id": "primitive-empty-and-null-schemas",
663 "description": "An empty schema accepts any value while a pure null schema accepts only null.",
664 "schema": {
665 "type": "object",
666 "properties": { "anything": {}, "nullOnly": { "type": "null" } },
667 "required": ["anything", "nullOnly"]
668 },
669 "instances": [
670 { "input": { "anything": 42, "nullOnly": null }, "accepted": true },
671 { "input": { "anything": null, "nullOnly": "not-null" }, "accepted": false }
672 ]
673 },
674 {
675 "id": "primitive-type-array-union",
676 "description": "Every member of a JSON Schema type array remains accepted.",
677 "schema": {
678 "type": "object",
679 "properties": { "value": { "type": ["string", "integer", "null"] } },
680 "required": ["value"]
681 },
682 "instances": [
683 { "input": { "value": "ready" }, "accepted": true },
684 { "input": { "value": 2 }, "accepted": true },
685 { "input": { "value": null }, "accepted": true },
686 { "input": { "value": true }, "accepted": false }
687 ]
688 },
689 {
690 "id": "primitive-enum-intersects-declared-type",
691 "description": "Enum values cannot bypass the schema's declared JSON type.",
692 "schema": {
693 "type": "object",
694 "properties": { "value": { "type": "string", "enum": [1, "ready"] } },
695 "required": ["value"]
696 },
697 "instances": [
698 { "input": { "value": "ready" }, "accepted": true },
699 { "input": { "value": 1 }, "accepted": false },
700 { "input": { "value": "other" }, "accepted": false }
701 ]
702 },
703 {
704 "id": "primitive-null-only-unions",
705 "description": "A union containing only null accepts only null.",
706 "schema": {
707 "type": "object",
708 "properties": {
709 "typeArray": { "type": ["null"] },
710 "anyOf": { "anyOf": [{ "type": "null" }] }
711 },
712 "required": ["typeArray", "anyOf"]
713 },
714 "instances": [
715 { "input": { "typeArray": null, "anyOf": null }, "accepted": true },
716 { "input": { "typeArray": "anything", "anyOf": null }, "accepted": false },
717 { "input": { "typeArray": null, "anyOf": 1 }, "accepted": false }
718 ]
719 },
720 {
721 "id": "primitive-scalar-constraints",
722 "description": "String and numeric constraints survive conversion together.",
723 "schema": {
724 "type": "object",
725 "properties": {
726 "code": { "type": "string", "pattern": "^[A-Z]{2}$", "minLength": 2, "maxLength": 2 },
727 "count": { "type": "number", "exclusiveMinimum": 0, "multipleOf": 2 }
728 },
729 "required": ["code", "count"]
730 },
731 "instances": [
732 { "input": { "code": "OK", "count": 2 }, "accepted": true },
733 { "input": { "code": "ok", "count": 2 }, "accepted": false },
734 { "input": { "code": "OK", "count": 0 }, "accepted": false },
735 { "input": { "code": "OK", "count": 3 }, "accepted": false }
736 ]
737 },
738 {
739 "id": "primitive-independent-numeric-bounds",
740 "description": "Inclusive and numeric exclusive bounds apply independently under Draft 7.",
741 "schema": {
742 "type": "object",
743 "properties": {
744 "lower": { "type": "number", "minimum": 0, "exclusiveMinimum": 5 },
745 "upper": { "type": "number", "maximum": 10, "exclusiveMaximum": 5 }
746 },
747 "required": ["lower", "upper"]
748 },
749 "instances": [
750 { "input": { "lower": 6, "upper": 4 }, "accepted": true },
751 { "input": { "lower": 1, "upper": 4 }, "accepted": false },
752 { "input": { "lower": 6, "upper": 9 }, "accepted": false },
753 { "input": { "lower": 5, "upper": 5 }, "accepted": false }
754 ]
755 },
756 {
757 "id": "primitive-const-intersects-declared-type",
758 "description": "A const that conflicts with the declared type is unsatisfiable.",
759 "schema": {
760 "type": "object",
761 "properties": { "value": { "type": "string", "const": 1 } },
762 "required": ["value"]
763 },
764 "instances": [
765 { "input": { "value": 1 }, "accepted": false },
766 { "input": { "value": "1" }, "accepted": false }
767 ]
768 },
769 {
770 "id": "primitive-compound-enum-values",
771 "description": "Enum values may contain any JSON value, including objects and arrays.",
772 "schema": {
773 "type": "object",
774 "properties": {
775 "value": { "enum": [{ "mode": "safe" }, ["ready", 1]] }
776 },
777 "required": ["value"]
778 },
779 "instances": [
780 { "input": { "value": { "mode": "safe" } }, "accepted": true },
781 { "input": { "value": ["ready", 1] }, "accepted": true },
782 { "input": { "value": ["ready", true] }, "accepted": false },
783 { "input": { "value": { "mode": true } }, "accepted": false },
784 { "input": { "value": { "mode": "unsafe" } }, "accepted": false }
785 ]
786 },
787 {
788 "id": "primitive-const-null-and-false",
789 "description": "Falsy consts keep their identity: null and false accept only themselves.",
790 "schema": {
791 "type": "object",
792 "properties": { "maybe": { "const": null }, "flag": { "const": false } },
793 "required": ["maybe", "flag"]
794 },
795 "instances": [
796 { "input": { "maybe": null, "flag": false }, "accepted": true },
797 { "input": { "maybe": null, "flag": 0 }, "accepted": false },
798 { "input": { "maybe": "null", "flag": false }, "accepted": false }
799 ]
800 },
801 {
802 "id": "primitive-enum-boolean-number-identity",
803 "description": "Enum membership distinguishes booleans from the numbers they equal in most host languages.",
804 "schema": {
805 "type": "object",
806 "properties": { "bits": { "enum": [0, 1] }, "toggle": { "enum": [true] } },
807 "required": ["bits", "toggle"]
808 },
809 "instances": [
810 { "input": { "bits": 1, "toggle": true }, "accepted": true },
811 { "input": { "bits": 0, "toggle": true }, "accepted": true },
812 { "input": { "bits": true, "toggle": true }, "accepted": false },
813 { "input": { "bits": 1, "toggle": 1 }, "accepted": false },
814 { "input": { "bits": false, "toggle": true }, "accepted": false }
815 ]
816 },
817 {
818 "id": "primitive-enum-with-null-member",
819 "description": "A null enum member is accepted alongside other literal values.",
820 "schema": {
821 "type": "object",
822 "properties": { "value": { "enum": ["a", null] } },
823 "required": ["value"]
824 },
825 "instances": [
826 { "input": { "value": "a" }, "accepted": true },
827 { "input": { "value": null }, "accepted": true },
828 { "input": { "value": "b" }, "accepted": false }
829 ]
830 },
831 {
832 "id": "primitive-const-constraint-conjunction",
833 "description": "A const must still satisfy sibling constraints; a conflict rejects everything.",
834 "schema": {
835 "type": "object",
836 "properties": { "code": { "type": "string", "const": "a", "minLength": 2 } },
837 "required": ["code"]
838 },
839 "instances": [
840 { "input": { "code": "a" }, "accepted": false },
841 { "input": { "code": "ab" }, "accepted": false }
842 ]
843 },
844 {
845 "id": "primitive-inclusive-numeric-boundaries",
846 "description": "Draft 7 minimum and maximum are inclusive bounds.",
847 "schema": {
848 "type": "object",
849 "properties": { "count": { "type": "integer", "minimum": 5, "maximum": 10 } },
850 "required": ["count"]
851 },
852 "instances": [
853 { "input": { "count": 5 }, "accepted": true },
854 { "input": { "count": 10 }, "accepted": true },
855 { "input": { "count": 4 }, "accepted": false },
856 { "input": { "count": 11 }, "accepted": false }
857 ]
858 },
859 {
860 "id": "primitive-const-narrows-enum",
861 "description": "When const and enum are both present, only their intersection is accepted.",
862 "schema": {
863 "type": "object",
864 "properties": { "value": { "enum": ["a", "b"], "const": "b" } },
865 "required": ["value"]
866 },
867 "instances": [
868 { "input": { "value": "b" }, "accepted": true },
869 { "input": { "value": "a" }, "accepted": false }
870 ]
871 },
872 {
873 "id": "primitive-compound-const-deep-equality",
874 "description": "A compound const compares by deep JSON equality, including boolean identity inside containers.",
875 "schema": {
876 "type": "object",
877 "properties": { "value": { "const": { "a": [1, "x", null] } } },
878 "required": ["value"]
879 },
880 "instances": [
881 { "input": { "value": { "a": [1, "x", null] } }, "accepted": true },
882 { "input": { "value": { "a": [1, "x", null], "b": 1 } }, "accepted": false },
883 { "input": { "value": { "a": [true, "x", null] } }, "accepted": false },
884 { "input": { "value": { "a": [1, "x"] } }, "accepted": false }
885 ]
886 },
887 {
888 "id": "primitive-unicode-code-point-length",
889 "description": "String length constraints count Unicode code points, not UTF-16 code units.",
890 "schema": {
891 "type": "object",
892 "properties": { "glyph": { "type": "string", "maxLength": 1 } },
893 "required": ["glyph"]
894 },
895 "instances": [
896 { "input": { "glyph": "𝄞" }, "accepted": true },
897 { "input": { "glyph": "ab" }, "accepted": false }
898 ]
899 },
900 {
901 "id": "primitive-typeless-constraint-scoping",
902 "description": "Draft 7 applies string constraints to string instances even without a declared type.",
903 "schema": {
904 "type": "object",
905 "properties": { "value": { "enum": ["a", "abc"], "minLength": 2 } },
906 "required": ["value"]
907 },
908 "instances": [
909 { "input": { "value": "abc" }, "accepted": true },
910 { "input": { "value": "a" }, "accepted": false }
911 ]
912 },
913 {
914 "id": "primitive-float-multiple-of",
915 "description": "Decimal multipleOf checks tolerate binary floating-point representation error.",
916 "divergesFromJsonSchema": "A literal Draft 7 multipleOf uses raw float arithmetic and rejects 0.3 for 0.1; every Composio converter scales decimals before comparing.",
917 "schema": {
918 "type": "object",
919 "properties": { "step": { "type": "number", "multipleOf": 0.1 } },
920 "required": ["step"]
921 },
922 "instances": [
923 { "input": { "step": 0.3 }, "accepted": true },
924 { "input": { "step": 0.35 }, "accepted": false }
925 ]
926 },
927 {
928 "id": "primitive-draft4-boolean-exclusive-bounds",
929 "description": "OpenAPI 3.0 style boolean exclusiveMinimum/exclusiveMaximum flags turn the paired bound exclusive.",
930 "schema": {
931 "type": "object",
932 "properties": {
933 "lower": { "type": "number", "minimum": 5, "exclusiveMinimum": true },
934 "upper": { "type": "number", "maximum": 5, "exclusiveMaximum": true }
935 },
936 "required": ["lower", "upper"]
937 },
938 "instances": [
939 { "input": { "lower": 6, "upper": 4 }, "accepted": true },
940 { "input": { "lower": 5, "upper": 4 }, "accepted": false },
941 { "input": { "lower": 6, "upper": 5 }, "accepted": false }
942 ]
943 },
944 {
945 "id": "primitive-type-array-constraint-scoping",
946 "description": "Constraints on a type array apply only to instances of their matching type.",
947 "schema": {
948 "type": "object",
949 "properties": {
950 "value": { "type": ["string", "number"], "minLength": 2, "minimum": 10 }
951 },
952 "required": ["value"]
953 },
954 "instances": [
955 { "input": { "value": "ab" }, "accepted": true },
956 { "input": { "value": 15 }, "accepted": true },
957 { "input": { "value": "a" }, "accepted": false },
958 { "input": { "value": 5 }, "accepted": false },
959 { "input": { "value": true }, "accepted": false }
960 ]
961 },
962 {
963 "id": "primitive-empty-enum-optional-property",
964 "description": "An optional property with an empty enum rejects every supplied value but tolerates absence.",
965 "schema": {
966 "type": "object",
967 "properties": { "value": { "enum": [] } },
968 "required": []
969 },
970 "instances": [
971 { "input": {}, "accepted": true },
972 { "input": { "value": null }, "accepted": false }
973 ]
974 },
975 {
976 "id": "additional-property-default-materialization",
977 "description": "Composio divergence: a schema-valued `additionalProperties` also materializes defaults in Zod and Pydantic while Effect leaves the input unchanged.",
978 "divergesFromJsonSchema": "`default` is annotation-only in JSON Schema; the Zod and Pydantic converters materialize it.",
979 "schema": {
980 "type": "object",
981 "properties": { "name": { "type": "string" } },
982 "additionalProperties": {
983 "type": "object",
984 "properties": { "enabled": { "type": "boolean", "default": false } }
985 }
986 },
987 "ingress": {
988 "accepted": true,
989 "preserved": {
990 "type": "object",
991 "properties": { "name": { "type": "string" } },
992 "additionalProperties": {
993 "type": "object",
994 "properties": { "enabled": { "type": "boolean", "default": false } }
995 }
996 }
997 },
998 "instances": [
999 {
1000 "input": { "name": "a", "extra": {} },
1001 "accepted": true,
1002 "zod": { "output": { "name": "a", "extra": { "enabled": false } } },
1003 "effect": { "output": { "name": "a", "extra": {} } },
1004 "python": { "output": { "name": "a", "extra": { "enabled": false } } }
1005 }
1006 ]
1007 },
1008 {
1009 "id": "composition-fixed-tuple-items",
1010 "description": "Draft 7 tuple items preserve position, optional shorter arrays, and an additionalItems false bound.",
1011 "schema": {
1012 "$schema": "http://json-schema.org/draft-07/schema#",
1013 "type": "object",
1014 "properties": {
1015 "value": {
1016 "type": "array",
1017 "items": [{ "type": "string" }, { "type": "integer" }],
1018 "additionalItems": false
1019 }
1020 },
1021 "required": ["value"]
1022 },
1023 "instances": [
1024 { "input": { "value": [] }, "accepted": true },
1025 { "input": { "value": ["ready"] }, "accepted": true },
1026 { "input": { "value": ["ready", 2] }, "accepted": true },
1027 { "input": { "value": [2, "ready"] }, "accepted": false },
1028 { "input": { "value": ["ready", 2, true] }, "accepted": false }
1029 ]
1030 },
1031 {
1032 "id": "composition-open-tuple-items",
1033 "description": "Tuple items default to Draft 7 and allow unconstrained trailing values unless additionalItems closes them.",
1034 "schema": {
1035 "type": "object",
1036 "properties": {
1037 "value": {
1038 "type": "array",
1039 "items": [{ "type": "string" }, { "type": "integer" }]
1040 }
1041 },
1042 "required": ["value"]
1043 },
1044 "instances": [
1045 { "input": { "value": ["ready", 2, { "extra": true }] }, "accepted": true },
1046 { "input": { "value": ["ready", "wrong"] }, "accepted": false }
1047 ]
1048 },
1049 {
1050 "id": "composition-false-tuple-position",
1051 "description": "A false positional schema rejects a value only when that position is present.",
1052 "schema": {
1053 "$schema": "http://json-schema.org/draft-07/schema#",
1054 "type": "object",
1055 "properties": {
1056 "value": {
1057 "type": "array",
1058 "items": [{ "type": "string" }, false],
1059 "additionalItems": false
1060 }
1061 },
1062 "required": ["value"]
1063 },
1064 "instances": [
1065 { "input": { "value": ["ready"] }, "accepted": true },
1066 { "input": { "value": ["ready", "forbidden"] }, "accepted": false }
1067 ]
1068 },
1069 {
1070 "id": "composition-allof-object-intersection",
1071 "description": "Every allOf object branch remains required after conversion.",
1072 "schema": {
1073 "type": "object",
1074 "properties": {
1075 "value": {
1076 "allOf": [
1077 {
1078 "type": "object",
1079 "properties": { "a": { "type": "string" } },
1080 "required": ["a"],
1081 "additionalProperties": true
1082 },
1083 {
1084 "type": "object",
1085 "properties": { "b": { "type": "integer" } },
1086 "required": ["b"],
1087 "additionalProperties": true
1088 }
1089 ]
1090 }
1091 },
1092 "required": ["value"]
1093 },
1094 "instances": [
1095 { "input": { "value": { "a": "ready", "b": 2 } }, "accepted": true },
1096 { "input": { "value": { "a": "ready" } }, "accepted": false },
1097 { "input": { "value": { "b": 2 } }, "accepted": false }
1098 ]
1099 },
1100 {
1101 "id": "composition-allof-closed-object-branches",
1102 "description": "Closed allOf object branches merge instead of rejecting each other's keys; the union of declared keys stays strict.",
1103 "schema": {
1104 "type": "object",
1105 "properties": {
1106 "value": {
1107 "allOf": [
1108 {
1109 "type": "object",
1110 "properties": { "a": { "type": "string" } },
1111 "required": ["a"]
1112 },
1113 {
1114 "type": "object",
1115 "properties": { "b": { "type": "string" } },
1116 "required": ["b"]
1117 }
1118 ]
1119 }
1120 },
1121 "required": ["value"]
1122 },
1123 "instances": [
1124 { "input": { "value": { "a": "ready", "b": "set" } }, "accepted": true },
1125 { "input": { "value": { "a": "ready" } }, "accepted": false },
1126 { "input": { "value": { "a": "ready", "b": "set", "c": 1 } }, "accepted": false }
1127 ]
1128 },
1129 {
1130 "id": "composition-scalar-allof",
1131 "description": "Scalar allOf branches combine rather than selecting the first branch.",
1132 "schema": {
1133 "type": "object",
1134 "properties": {
1135 "value": {
1136 "allOf": [
1137 { "type": "string", "minLength": 2 },
1138 { "type": "string", "pattern": "^[A-Z]+$" }
1139 ]
1140 }
1141 },
1142 "required": ["value"]
1143 },
1144 "instances": [
1145 { "input": { "value": "OK" }, "accepted": true },
1146 { "input": { "value": "O" }, "accepted": false },
1147 { "input": { "value": "ok" }, "accepted": false }
1148 ]
1149 },
1150 {
1151 "id": "composition-oneof-exclusive-match",
1152 "description": "oneOf accepts exactly one matching branch, not a plain union of branches.",
1153 "schema": {
1154 "type": "object",
1155 "properties": {
1156 "value": {
1157 "oneOf": [
1158 { "type": "number", "minimum": 0 },
1159 { "type": "number", "maximum": 0 }
1160 ]
1161 }
1162 },
1163 "required": ["value"]
1164 },
1165 "instances": [
1166 { "input": { "value": 1 }, "accepted": true },
1167 { "input": { "value": -1 }, "accepted": true },
1168 { "input": { "value": 0 }, "accepted": false },
1169 { "input": { "value": "0" }, "accepted": false }
1170 ]
1171 }
1172 ]
1173 }