Creates a transformer.
OptionalonSchema: SchemaNodeHook
Optional hook consulted for every schema node, so a
caller can substitute a $ref for a reused schema at ANY depth rather
than only at the root. Omit it for a plain transform.
Optionalchannels: {Optional outbound channels for zod v4 $defs and
unrepresentable-node diagnostics. Entirely optional: without them the
zod v4 path still produces a complete, self-contained schema.
Transforms a Zod schema into an OpenAPI schema object.
The OpenAPI schema object representation
Converts a Zod schema to an OpenAPI 3.1 schema object.
Zod >=4.6.6 <5 is supported, detected by its public
toJSONSchemamethod. An unrecognized schema, including a legacy Zod v3 schema, degrades to{}— never a throw — and, when a diagnostics channel is attached, reports what it could not represent.Since
0.1.0