fix(json-schema-to-zod): issue #2109
This PR:
- adds a reproduction for #2109
- closes #2109
- updates
@composio/json-schema-to-zodso that it produces output consistent with the installed version of Zod- the supported versions of Zod are:
^3.25.0 || ^4.0.0
- the supported versions of Zod are:
Add dual Zod v3/v4 compatibility in ts/packages/json-schema-to-zod via zod-compat and refactor object additionalProperties handling to use catchall(z.any()) when true
Introduce a zod-compat layer and update parsers to operate with Zod v3/v4, adjust typing to ZodTypeAny, and refactor object parsing to treat additionalProperties true as catchall(z.any()) and false as strict(); add a Mastra example script and update example dependencies.
🖇️ Linked Issues
This pull request addresses issue #2109 referenced in the title by implementing Zod version compatibility within the json-schema-to-zod package.
📍Where to Start
Start with the zod-compat module in zod-compat.ts, then review the entry point jsonSchemaToZod in json-schema-to-zod.ts and the object parser changes in parse-object.ts.
📊 Macroscope summarized 82d0618. 16 files reviewed, 21 issues evaluated, 20 issues filtered, 1 comment posted. View details
Waiting on this PR! Would be great to have this in.