# What changed in @asteasolutions/zod-to-openapi

> 28 changes in @asteasolutions/zod-to-openapi 8 to 9 from its official release notes, upgrade guides and advisories: 2 breaking, 19 new APIs and options. Each one cited. Sources checked 2026-10-18. HTML: https://unstale.sh/npm/@asteasolutions/zod-to-openapi/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @asteasolutions/zod-to-openapi 9

### Breaking changes

- ResponseConfig.description is now optional; code assuming it is always present may need a guard or non-null assertion. (9.0.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.0.0)

### New APIs and options

- Adds string format support for z.base64url(). (9.1.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.1.0)
- Adds string format support for z.cidrv4(). (9.1.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.1.0)
- Adds string format support for z.cidrv6(). (9.1.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.1.0)
- Adds string format support for z.guid(). (9.1.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.1.0)
- Adds string format support for z.iso.duration(). (9.1.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.1.0)
- Adds string format support for z.iso.time(). (9.1.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.1.0)
- Supports the OpenAPI 3.2 media-type field itemEncoding, including for streaming media types. (9.0.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.0.0)
- Supports the OpenAPI 3.2 media-type field itemSchema, including for streaming media types. (9.0.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.0.0)
- Adds a generator for OpenAPI 3.2.0 documents, using the same JSON Schema dialect as 3.1. (9.0.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.0.0)
- Supports the OpenAPI 3.2 media-type field prefixEncoding, including for streaming media types. (9.0.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.0.0)
- Routes can use the query HTTP method. (9.0.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.0.0)
- Allows mediaTypes to be registered as a reusable component type. (9.0.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.0.0)
- Responses can now include an optional summary. (9.0.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.0.0)
- Allows $ref entries directly in ZodContentObject. (9.0.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.0.0)

### Behavior and default changes

- ZodMediaTypeObject.schema is now optional to support itemSchema-only media types. (9.0.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.0.0)

### Fixes and other changes

- Corrects the regex used for bigint OpenAPI, fixing generated OpenAPI output. (9.1.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.1.0)
- Corrects discriminator mapping for nested discriminated unions. (9.1.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.1.0)

## @asteasolutions/zod-to-openapi 8

### Breaking changes

- Using z.date now generates date-time instead of date. (8.3.3) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v8.3.3)

### New APIs and options

- Exported OpenApiOptions to resolve a problem when extending an object schema. (8.4.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v8.4.0)
- Added support for z.json schemas. (8.4.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v8.4.0)
- Added support for template literals. (8.4.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v8.4.0)
- Support was added for z.lazy and recursive schemas with getters. (8.3.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v8.3.0)
- Adds support for the Zod v4 prefault type when generating OpenAPI schemas. (8.2.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v8.2.0)

### Fixes and other changes

- Nested discriminated unions are now allowed, matching support in Zod v4. (8.5.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v8.5.0)
- Fixed a memory leak when using request parameters with generateDocument(). (8.4.1) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v8.4.1)
- Fixed a bug in some nested structures when using isAnyZodType with null or undefined. (8.4.0) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v8.4.0)
- Adds a null option for nullable enums. (8.3.3) — [release notes](https://github.com/asteasolutions/zod-to-openapi/releases/tag/v8.3.3)
