Any Zod schema instance.
A JSON Schema-compatible plain object.
const jsonSchema = lowerZodToJsonSchema(z.object({ name: z.string(), age: z.number().optional() }));
// → { type: 'object', properties: { name: { type: 'string' }, age: { type: 'number' } }, required: ['name'] }
Converts a Zod schema instance to a plain JSON Schema object.
Recursively descends into ZodObject shapes, ZodArray item types, ZodOptional and ZodDefault wrappers, transparently unwrapping them so the produced JSON Schema is clean and does not contain Zod-specific metadata.