npm / @asteasolutions/zod-to-openapi
@asteasolutions/zod-to-openapi
What changed in @asteasolutions/zod-to-openapi 8 to 9, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
2 breaking19 new APIs and options1 behavior and defaults6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@asteasolutions/zod-to-openapi 918 changes
Breaking changes 1
ResponseConfig.description is now optional; code assuming it is always present may need a guard or non-null assertion.
New APIs and options 14
Adds string format support for z.base64url().
Adds string format support for z.cidrv4().
Adds string format support for z.cidrv6().
Adds string format support for z.guid().
Adds string format support for z.iso.duration().
Adds string format support for z.iso.time().
Supports the OpenAPI 3.2 media-type field itemEncoding, including for streaming media types.
Supports the OpenAPI 3.2 media-type field itemSchema, including for streaming media types.
Adds a generator for OpenAPI 3.2.0 documents, using the same JSON Schema dialect as 3.1.
Supports the OpenAPI 3.2 media-type field prefixEncoding, including for streaming media types.
Routes can use the query HTTP method.
Allows mediaTypes to be registered as a reusable component type.
Responses can now include an optional summary.
Allows $ref entries directly in ZodContentObject.
Behavior and default changes 1
ZodMediaTypeObject.schema is now optional to support itemSchema-only media types.
Fixes and other changes 2
Corrects the regex used for bigint OpenAPI, fixing generated OpenAPI output.
Corrects discriminator mapping for nested discriminated unions.
@asteasolutions/zod-to-openapi 810 changes
Breaking changes 1
Using z.date now generates date-time instead of date.
New APIs and options 5
Exported OpenApiOptions to resolve a problem when extending an object schema.
Added support for z.json schemas.
Added support for template literals.
Support was added for z.lazy and recursive schemas with getters.
Adds support for the Zod v4 prefault type when generating OpenAPI schemas.
Fixes and other changes 4
Nested discriminated unions are now allowed, matching support in Zod v4.
Fixed a memory leak when using request parameters with generateDocument().
Fixed a bug in some nested structures when using isAnyZodType with null or undefined.
Adds a null option for nullable enums.