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
+ "instances": [
38
+ {
39
+ "input": { "anything": { "a": 1 }, "other": "x" },
40
+ "accepted": true,
41
+ "zod": { "output": { "anything": { "a": 1 }, "other": "x" } },
42
+ "effect": { "output": { "anything": { "a": 1 }, "other": "x" } },
43
+ "python": { "output": { "anything": { "a": 1 }, "other": "x" } }
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "id": "root-free-form-empty-properties",
49
+ "description": "`properties: {}` is property-less too, and stays open when `additionalProperties` is omitted.",
50
+ "schema": { "type": "object", "properties": {} },
51
+ "ingress": {
52
+ "accepted": true,
53
+ "preserved": { "type": "object", "properties": {} }
54
+ },
55
+ "instances": [
56
+ {
57
+ "input": { "foo": 1, "bar": { "baz": true } },
58
+ "accepted": true,
59
+ "zod": { "output": { "foo": 1, "bar": { "baz": true } } },
60
+ "effect": { "output": { "foo": 1, "bar": { "baz": true } } },
61
+ "python": { "output": { "foo": 1, "bar": { "baz": true } } }
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "id": "free-form-object-in-array-items",
67
+ "description": "Property-less objects placed as array items preserve arbitrary content.",
68
+ "schema": {
69
+ "type": "object",
70
+ "properties": {
71
+ "records": { "type": "array", "items": { "type": "object" } }
72
+ }
73
+ },
74
+ "ingress": {
75
+ "accepted": true,
76
+ "preserved": {
77
+ "type": "object",
78
+ "properties": {
79
+ "records": { "type": "array", "items": { "type": "object" } }
80
+ }
81
+ }
82
+ },
83
+ "instances": [
84
+ {
85
+ "input": { "records": [{ "a": 1 }, { "b": { "c": 2 } }] },
86
+ "accepted": true,
87
+ "zod": { "output": { "records": [{ "a": 1 }, { "b": { "c": 2 } }] } },
88
+ "effect": { "output": { "records": [{ "a": 1 }, { "b": { "c": 2 } }] } },
89
+ "python": { "output": { "records": [{ "a": 1 }, { "b": { "c": 2 } }] } }
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ "id": "explicit-additional-properties-false",
95
+ "description": "An explicit `additionalProperties: false` closes an otherwise property-less object.",
96
+ "schema": { "type": "object", "properties": {}, "additionalProperties": false },
97
+ "ingress": {
98
+ "accepted": true,
99
+ "preserved": { "type": "object", "properties": {}, "additionalProperties": false }
100
+ },
101
+ "instances": [
102
+ {
103
+ "input": {},
104
+ "accepted": true,
105
+ "zod": { "output": {} },
106
+ "effect": { "output": {} },
107
+ "python": { "output": {} }
108
+ },
109
+ {
110
+ "input": { "foo": 1 },
111
+ "accepted": false
112
+ }
113
+ ]
114
+ },
115
+ {
116
+ "id": "explicit-additional-properties-true",
117
+ "description": "An explicit `additionalProperties: true` preserves unknown keys alongside named properties.",
118
+ "schema": {
119
+ "type": "object",
120
+ "properties": { "name": { "type": "string" } },
121
+ "additionalProperties": true
122
+ },
123
+ "ingress": {
124
+ "accepted": true,
125
+ "preserved": {
126
+ "type": "object",
127
+ "properties": { "name": { "type": "string" } },
128
+ "additionalProperties": true
129
+ }
130
+ },
131
+ "instances": [
132
+ {
133
+ "input": { "name": "a", "extra": 1 },
134
+ "accepted": true,
135
+ "zod": { "output": { "name": "a", "extra": 1 } },
136
+ "effect": { "output": { "name": "a", "extra": 1 } },
137
+ "python": { "output": { "name": "a", "extra": 1 } }
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ "id": "named-properties-strict-by-default",
143
+ "description": "Composio divergence: named `properties` with omitted `additionalProperties` stay strict for tool inputs, while JSON Schema itself would allow unknown keys.",
144
+ "divergesFromJsonSchema": "JSON Schema treats omitted `additionalProperties` as permissive; Composio tool inputs keep it strict.",
145
+ "schema": {
146
+ "type": "object",
147
+ "properties": { "name": { "type": "string" } },
148
+ "required": ["name"]
149
+ },
150
+ "ingress": {
151
+ "accepted": true,
152
+ "preserved": {
153
+ "type": "object",
154
+ "properties": { "name": { "type": "string" } },
155
+ "required": ["name"]
156
+ }
157
+ },
158
+ "instances": [
159
+ {
160
+ "input": { "name": "a" },
161
+ "accepted": true,
162
+ "zod": { "output": { "name": "a" } },
163
+ "effect": { "output": { "name": "a" } },
164
+ "python": { "output": { "name": "a" } }
165
+ },
166
+ {
167
+ "input": { "name": "a", "extra": 1 },
168
+ "accepted": false
169
+ }
170
+ ]
171
+ },
172
+ {
173
+ "id": "named-properties-with-pattern-properties",
174
+ "description": "With named `properties` plus `patternProperties` and omitted `additionalProperties`, pattern-matching keys are admitted and validated while other unknown keys stay rejected.",
175
+ "schema": {
176
+ "type": "object",
177
+ "properties": { "name": { "type": "string" } },
178
+ "patternProperties": { "^x-": { "type": "number" } }
179
+ },
180
+ "ingress": {
181
+ "accepted": true,
182
+ "preserved": {
183
+ "type": "object",
184
+ "properties": { "name": { "type": "string" } },
185
+ "patternProperties": { "^x-": { "type": "number" } }
186
+ }
187
+ },
188
+ "instances": [
189
+ {
190
+ "input": { "name": "a", "x-count": 3 },
191
+ "accepted": true,
192
+ "zod": { "output": { "name": "a", "x-count": 3 } },
193
+ "effect": { "output": { "name": "a", "x-count": 3 } },
194
+ "python": { "output": { "name": "a", "x-count": 3 } }
195
+ },
196
+ {
197
+ "input": { "name": "a", "x-count": "nope" },
198
+ "accepted": false
199
+ },
200
+ {
201
+ "input": { "name": "a", "other": 1 },
202
+ "accepted": false
203
+ }
204
+ ]
205
+ },
206
+ {
207
+ "id": "root-additional-properties-schema-valued",
208
+ "description": "A schema-valued root `additionalProperties` survives `ToolSchema.parse` and validates unknown keys.",
209
+ "schema": {
210
+ "type": "object",
211
+ "properties": { "name": { "type": "string" } },
212
+ "additionalProperties": { "type": "number" }
213
+ },
214
+ "ingress": {
215
+ "accepted": true,
216
+ "preserved": {
217
+ "type": "object",
218
+ "properties": { "name": { "type": "string" } },
219
+ "additionalProperties": { "type": "number" }
220
+ }
221
+ },
222
+ "instances": [
223
+ {
224
+ "input": { "name": "a", "count": 2 },
225
+ "accepted": true,
226
+ "zod": { "output": { "name": "a", "count": 2 } },
227
+ "effect": { "output": { "name": "a", "count": 2 } },
228
+ "python": { "output": { "name": "a", "count": 2 } }
229
+ },
230
+ {
231
+ "input": { "name": "a", "count": "x" },
232
+ "accepted": false
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ "id": "pattern-only-object",
238
+ "description": "A pattern-only object with no named `properties` accepts unmatched keys while still validating matched ones.",
239
+ "schema": {
240
+ "type": "object",
241
+ "patternProperties": { "^s_": { "type": "string" } }
242
+ },
243
+ "instances": [
244
+ {
245
+ "input": { "s_a": "x", "other": 1 },
246
+ "accepted": true,
247
+ "zod": { "output": { "s_a": "x", "other": 1 } },
248
+ "effect": { "output": { "s_a": "x", "other": 1 } },
249
+ "python": { "output": { "s_a": "x", "other": 1 } }
250
+ },
251
+ {
252
+ "input": { "s_a": 5 },
253
+ "accepted": false
254
+ }
255
+ ]
256
+ },
257
+ {
258
+ "id": "multiple-matching-patterns",
259
+ "description": "A key matching several non-transforming patterns must satisfy all of them.",
260
+ "schema": {
261
+ "type": "object",
262
+ "patternProperties": {
263
+ "^a": { "type": "string" },
264
+ "b$": { "type": "string", "minLength": 2 }
265
+ }
266
+ },
267
+ "instances": [
268
+ {
269
+ "input": { "ab": "xy" },
270
+ "accepted": true,
271
+ "zod": { "output": { "ab": "xy" } },
272
+ "effect": { "output": { "ab": "xy" } },
273
+ "python": { "output": { "ab": "xy" } }
274
+ },
275
+ {
276
+ "input": { "ab": "x" },
277
+ "accepted": false
278
+ },
279
+ {
280
+ "input": { "ab": 5 },
281
+ "accepted": false
282
+ }
283
+ ]
284
+ },
285
+ {
286
+ "id": "declared-property-also-matching-a-pattern",
287
+ "description": "A key declared in `properties` is still checked against every matching pattern.",
288
+ "schema": {
289
+ "type": "object",
290
+ "properties": { "x_id": { "type": "string" } },
291
+ "patternProperties": { "^x_": { "type": "string", "minLength": 3 } }
292
+ },
293
+ "ingress": {
294
+ "accepted": true,
295
+ "preserved": {
296
+ "type": "object",
297
+ "properties": { "x_id": { "type": "string" } },
298
+ "patternProperties": { "^x_": { "type": "string", "minLength": 3 } }
299
+ }
300
+ },
301
+ "instances": [
302
+ {
303
+ "input": { "x_id": "abc" },
304
+ "accepted": true,
305
+ "zod": { "output": { "x_id": "abc" } },
306
+ "effect": { "output": { "x_id": "abc" } },
307
+ "python": { "output": { "x_id": "abc" } }
308
+ },
309
+ {
310
+ "input": { "x_id": "ab" },
311
+ "accepted": false
312
+ }
313
+ ]
314
+ },
315
+ {
316
+ "id": "schema-valued-additional-applies-only-to-unmatched-keys",
317
+ "description": "Schema-valued `additionalProperties` must not rescue a key that a `patternProperties` entry already claims and rejects.",
318
+ "schema": {
319
+ "type": "object",
320
+ "properties": { "name": { "type": "string" } },
321
+ "patternProperties": { "^n_": { "type": "number" } },
322
+ "additionalProperties": { "type": "boolean" }
323
+ },
324
+ "ingress": {
325
+ "accepted": true,
326
+ "preserved": {
327
+ "type": "object",
328
+ "properties": { "name": { "type": "string" } },
329
+ "patternProperties": { "^n_": { "type": "number" } },
330
+ "additionalProperties": { "type": "boolean" }
331
+ }
332
+ },
333
+ "instances": [
334
+ {
335
+ "input": { "name": "a", "n_x": 1, "flag": true },
336
+ "accepted": true,
337
+ "zod": { "output": { "name": "a", "n_x": 1, "flag": true } },
338
+ "effect": { "output": { "name": "a", "n_x": 1, "flag": true } },
339
+ "python": { "output": { "name": "a", "n_x": 1, "flag": true } }
340
+ },
341
+ {
342
+ "input": { "name": "a", "n_x": true },
343
+ "accepted": false
344
+ },
345
+ {
346
+ "input": { "name": "a", "flag": 1 },
347
+ "accepted": false
348
+ }
349
+ ]
350
+ },
351
+ {
352
+ "id": "pattern-property-default-materialization",
353
+ "description": "Composio divergence: Zod and Pydantic materialize `default` inside a matching pattern schema, while Effect decoding is validation-only and returns the input unchanged.",
354
+ "divergesFromJsonSchema": "`default` is annotation-only in JSON Schema; the Zod and Pydantic converters materialize it.",
355
+ "schema": {
356
+ "type": "object",
357
+ "properties": {},
358
+ "patternProperties": {
359
+ "^p_": {
360
+ "type": "object",
361
+ "properties": { "mode": { "type": "string", "default": "auto" } }
362
+ }
363
+ }
364
+ },
365
+ "ingress": {
366
+ "accepted": true,
367
+ "preserved": {
368
+ "type": "object",
369
+ "properties": {},
370
+ "patternProperties": {
371
+ "^p_": {
372
+ "type": "object",
373
+ "properties": { "mode": { "type": "string", "default": "auto" } }
374
+ }
375
+ }
376
+ }
377
+ },
378
+ "instances": [
379
+ {
380
+ "input": { "p_a": {} },
381
+ "accepted": true,
382
+ "zod": { "output": { "p_a": { "mode": "auto" } } },
383
+ "effect": { "output": { "p_a": {} } },
384
+ "python": { "output": { "p_a": { "mode": "auto" } } }
385
+ }
386
+ ]
387
+ },
388
+ {
389
+ "id": "additional-property-default-materialization",
390
+ "description": "Composio divergence: a schema-valued `additionalProperties` also materializes defaults in Zod and Pydantic while Effect leaves the input unchanged.",
391
+ "divergesFromJsonSchema": "`default` is annotation-only in JSON Schema; the Zod and Pydantic converters materialize it.",
392
+ "schema": {
393
+ "type": "object",
394
+ "properties": { "name": { "type": "string" } },
395
+ "additionalProperties": {
396
+ "type": "object",
397
+ "properties": { "enabled": { "type": "boolean", "default": false } }
398
+ }
399
+ },
400
+ "ingress": {
401
+ "accepted": true,
402
+ "preserved": {
403
+ "type": "object",
404
+ "properties": { "name": { "type": "string" } },
405
+ "additionalProperties": {
406
+ "type": "object",
407
+ "properties": { "enabled": { "type": "boolean", "default": false } }
408
+ }
409
+ }
410
+ },
411
+ "instances": [
412
+ {
413
+ "input": { "name": "a", "extra": {} },
414
+ "accepted": true,
415
+ "zod": { "output": { "name": "a", "extra": { "enabled": false } } },
416
+ "effect": { "output": { "name": "a", "extra": {} } },
417
+ "python": { "output": { "name": "a", "extra": { "enabled": false } } }
418
+ }
419
+ ]
420
+ }
421
+ ]
422
+}