FindSoftware

Zod to OpenAPI

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

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.

Identity

Status
Active
Maintainer
Astea Solutions AD2
First release
20223
Headquarters
Bulgaria2

Rendering and deploy

Install with
npm4

Releases

Current major version
96
Last release
2026-07-196

Adoption

GitHub stars
1,6351
npm downloads a week
7,661,9457
Contributors
298
Dependent repositories
399
Dependent packages
549

Why these figures do not compare

Sources

  1. 2026-11-17: links, Written in, License, GitHub stars
    api.github.com/repos/asteasolutions/zod-to-openapi
  2. 2026-11-17: Maintainer, Headquarters
    asteasolutions.com/privacy/
  3. 2026-11-17: First release
    registry.npmjs.org/@asteasolutions/zod-to-openapi
  4. 2026-11-17: Categories, Built on, Install with
    github.com/asteasolutions/zod-to-openapi/blob/master/README.md
  5. 2026-11-17: License model
    github.com/asteasolutions/zod-to-openapi/blob/master/LICENSE
  6. 2026-11-17: Current major version, Last release
    github.com/asteasolutions/zod-to-openapi/releases/tag/v9.1.0
  7. 2026-11-17: npm downloads a week
    api.npmjs.org/downloads/range/2026-11-01:2026-11-07/@asteasolutions/zod-to-openapi
  8. 2026-11-17: Contributors
    api.github.com/repos/asteasolutions/zod-to-openapi/contributors?per_page=1
  9. 2026-11-17: Dependent packages, Dependent repositories
    packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/@asteasolutions/zod-to-openapi

Last reviewed · Listed since Edit on GitHubThis page as markdownas JSON