Function: zodToJSONSchema()
@providerprotocol/ai / utils / zodToJSONSchema
Function: zodToJSONSchema()
Section titled “Function: zodToJSONSchema()”zodToJSONSchema(
schema):Promise<JSONSchema>
Defined in: src/utils/zod.ts:161
Converts a Zod schema to JSON Schema.
For Zod v4+, uses native z.toJSONSchema().
For Zod v3, uses zod-to-json-schema package.
Parameters
Section titled “Parameters”schema
Section titled “schema”Zod schema to convert
Returns
Section titled “Returns”Promise<JSONSchema>
JSON Schema representation
Throws
Section titled “Throws”Error if required dependencies are not installed