zodToJsonSchema to convert Zod schemas to JSON Schema. This is particularly useful when defining event parameters in your workflow.
Usage
Function Signature
Example in Workflow Context
When defining events in your workflow, you can usezodToJsonSchema to generate the schema for event parameters:
Notes
- The
zodToJsonSchemafunction uses thezod-to-json-schemalibrary internally. - It applies some customizations to the output, such as omitting certain properties (
$ref,$schema,default,definitions,additionalProperties,description,markdownDescription). - The resulting JSON Schema is compatible with OpenAPI 3.0 specifications.