composio icon indicating copy to clipboard operation
composio copied to clipboard

fix(json-schema-to-zod): issue #2109

Open jkomyno opened this issue 1 month ago • 2 comments

This PR:

  • adds a reproduction for #2109
  • closes #2109
  • updates @composio/json-schema-to-zod so that it produces output consistent with the installed version of Zod
    • the supported versions of Zod are: ^3.25.0 || ^4.0.0

jkomyno avatar Nov 11 '25 05:11 jkomyno

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

macroscopeapp[bot] avatar Nov 11 '25 05:11 macroscopeapp[bot]

Waiting on this PR! Would be great to have this in.

nsoliven avatar Nov 30 '25 06:11 nsoliven