# Zod to OpenAPI

TypeScript library that generates OpenAPI (Swagger) documentation from Zod schemas and route definitions.


Source: https://findsoftware.frbit.cloud/zod-to-openapi/
Last reviewed: 2026-11-17
Listed since: 2026-11-17

## Record

### Links

- repository: https://github.com/asteasolutions/zod-to-openapi

### Identity

- status: active
- maintainer: Astea Solutions AD
- maintainerType: unknown
- parent: unknown
- firstRelease: 2022
- hqCountry: BG

### Kind

- category: backend
- hosting: unknown
- language: javascript
- runtime: unknown
- runtimeMin: unknown
- basedOn: zod

### Content

- contentStore: unknown
- databases: unknown
- adminUi: unknown
- headlessApi: unknown
- templating: unknown
- i18n: unknown

### Rendering and deploy

- runsAs: unknown
- renderingModes: unknown
- installMethod: npm

### License

- licenseModel: open-source
- license: MIT

### Releases

- currentMajor: 9
- latestReleaseDate: 2026-07-19

### Adoption

- githubStargazers: 1635
- packagistDownloads: not applicable
- npmWeeklyDownloads: 7661945
- contributors: 29
- pluginCount: unknown
- packagistMonthlyDownloads: unknown
- ecosystemsMonthlyDownloads: unknown
- httpArchiveSites: unknown
- wordpressActiveInstalls: unknown
- dependentRepos: 39
- dependentPackages: 54

### Sources

- urls: https://api.github.com/repos/asteasolutions/zod-to-openapi (read 2026-11-17)
- maintainer: https://asteasolutions.com/privacy/ (read 2026-11-17)
- hqCountry: https://asteasolutions.com/privacy/ (read 2026-11-17)
- firstRelease: https://registry.npmjs.org/@asteasolutions/zod-to-openapi (read 2026-11-17)
- language: https://api.github.com/repos/asteasolutions/zod-to-openapi (read 2026-11-17)
- category: https://github.com/asteasolutions/zod-to-openapi/blob/master/README.md (read 2026-11-17)
- basedOn: https://github.com/asteasolutions/zod-to-openapi/blob/master/README.md (read 2026-11-17)
- installMethod: https://github.com/asteasolutions/zod-to-openapi/blob/master/README.md (read 2026-11-17)
- license: https://api.github.com/repos/asteasolutions/zod-to-openapi (read 2026-11-17)
- licenseModel: https://github.com/asteasolutions/zod-to-openapi/blob/master/LICENSE (read 2026-11-17)
- currentMajor: https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.1.0 (read 2026-11-17)
- latestReleaseDate: https://github.com/asteasolutions/zod-to-openapi/releases/tag/v9.1.0 (read 2026-11-17)
- npmWeeklyDownloads: https://api.npmjs.org/downloads/range/2026-11-01:2026-11-07/@asteasolutions/zod-to-openapi (read 2026-11-17)
- githubStargazers: https://api.github.com/repos/asteasolutions/zod-to-openapi (read 2026-11-17)
- contributors: https://api.github.com/repos/asteasolutions/zod-to-openapi/contributors?per_page=1 (read 2026-11-17)
- dependentPackages: https://packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/@asteasolutions/zod-to-openapi (read 2026-11-17)
- dependentRepos: https://packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/@asteasolutions/zod-to-openapi (read 2026-11-17)

## Notes

Zod to OpenAPI reads the Zod schemas and route definitions of a TypeScript API and writes an OpenAPI document from them, so the schemas that validate requests also describe them. Schemas are named with an `openapi` method that Zod objects gain once the library extends Zod, and a registry collects named schemas, parameters and paths. A generator turns the registry into the components section or a full document for OpenAPI 3.0, 3.1 or 3.2. The README shows a script in the build step that writes the document to a file such as `openapi-docs.json`.

## Worth knowing

For Zod 3 schemas, the README points to an older release line that its maintainers say they do not intend to support going forward. Calling `z.nullable()` on a registered schema does not produce a reference to it; the README suggests the schema's own `.nullable()` method instead. Schemas of types the library does not support raise an error unless the type is given by hand through the `openapi` method.

---

Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Attributes are recorded, never scored; absent means unknown.
Credit, in full: FindSoftware, CC BY 4.0
