Elestia Open Source Ratings
6.9

zod-to-openapi

Reasonable, with limits. 6th of 9 OpenAPI tools.

zod-to-openapi builds an OpenAPI 3.0, 3.1 or 3.2 document from Zod schemas and registered routes. It is a solid, actively maintained choice for code-first APIs that already use Zod, and Hono's official OpenAPI middleware builds on it. It is narrower than the spec-first generators and doc renderers in this category, and much of its download growth comes through Hono rather than from people picking it directly.

Best for: TypeScript teams that already validate with Zod and want an OpenAPI document generated from those schemas, in any framework.

GitHubnpm

Scores

Overall6.9

How strongly do we recommend it for a new project today?

Claude Opus 5.5: 6.5, likely 5.5 to 7.5

It is a good, well-kept tool for writing OpenAPI from Zod in code, with current Zod 4 and OpenAPI 3.2 support and a light dependency footprint. Its scope is narrow: it writes the spec, and other tools in the category make the clients and docs. Lighter Zod-native rivals and Hono's wrapper are often the easier entry point, so it is a strong pick only for Zod-first teams.

GPT-6.2 Sol: 7.2, likely 6.0 to 8.3

This is a strong pick for a new Zod 4 API that needs to publish an OpenAPI contract, especially when it needs 3.2 output. For teams starting with an existing spec, openapi-typescript handles type generation and Swagger UI handles interactive reference docs. Open schema-conversion bugs and reliance on one visible release maintainer keep the recommendation below the category’s top tier.

Needed by many4.1

How many developers need a tool for this job?

Claude Opus 5.5: 4.0, likely 3.0 to 5.5

It serves one slice of the OpenAPI job: code-first spec writing for projects that use Zod. Zod is very common, but many API teams start from a spec, use another validator, or let their framework write the document. It is narrower than peers like Swagger UI or openapi-typescript.

GPT-6.2 Sol: 4.2, likely 3.0 to 5.4

OpenAPI is useful across many HTTP API projects, and State of JavaScript shows growing Zod use. This package serves the narrower group that defines its API models in Zod and generates the contract from code. It works across server frameworks, but the share of teams using that workflow is hard to measure.

Helps a lot7.3

How well does it do the job for those who need it?

Claude Opus 5.5: 7.0, likely 6.0 to 8.0

It is mature and complete for its job. It has a registry for schemas, routes, webhooks and components, generators for OpenAPI 3.0, 3.1 and 3.2, and support for Zod 4 .meta(). Recent releases keep fixing edge cases such as nested discriminated unions and new string formats. The extendZodWithOpenApi patch and Zod-only scope are real limits, and lighter rivals exist.

GPT-6.2 Sol: 7.5, likely 6.3 to 8.5

Version 9.1.0 has a typed registry, clear examples, and three OpenAPI targets. Users report incorrect regex patterns and missing constraints on reused schemas, and Sam Chung’s zod-openapi provides explicit handling for distinct request and response shapes. Evidence on generation speed and AI-written integrations is thin.

Holds up over time6.6

Will it still be a good choice in two years?

Claude Opus 5.5: 6.5, likely 5.0 to 7.5

It had 12 releases and 62 commits in the last year, and the last push was in October 2026. It moved quickly to Zod 4 and OpenAPI 3.2. A small company team maintains it, with 34 contributors and 16 open PRs. The v9 breaking changes were limited to types. A risk is that Zod's native JSON Schema output and leaner rivals could shrink the need for it over time.

  • github commitsLastYear / releasesLastYear: 62 commits and 12 releases in the last year.
  • github openPullRequests: 16 open PRs and 30 open issues against 171 closed.
  • github.com/asteasolutions/zod-to-openapi/releases: The v9 breaking changes were TypeScript interface changes only.
  • zod.dev/json-schema: Zod 4 has a native toJSONSchema with an openapi-3.0 target.

GPT-6.2 Sol: 6.6, likely 5.1 to 7.9

The project recorded 62 commits and 12 releases in a year, including support for OpenAPI 3.2. The last release was in July, several fixes are still awaiting review, and recent releases have come from one visible publisher. The move to Zod 4 prompted migration complaints, while v9 made smaller changes to TypeScript interfaces. Hono’s ongoing use helps, though long-term funding and backup release ownership remain unclear.

Used widely5.3

How many use it, and is that growing?

Claude Opus 5.5: 6.0, likely 4.5 to 7.0

Downloads are 31.8M per 4 weeks, up 7.3x from a year ago, which is above the 4.1 median. Much of that comes from @hono/zod-openapi and other packages that install it, not from direct choices. ecosyste.ms counts only 39 dependent repos and 54 packages, far below openapi-typescript's 8,379. Direct users are probably in the tens of thousands.

GPT-6.2 Sol: 4.5, likely 2.9 to 6.2

Four-week installs rose from 4.35 million to 31.83 million, about 7.3× year over year against the catalog median of 4.1×. That is close to Orval’s growth and trails openapi-typescript and Hey API. Hono’s middleware adds indirect installs, while the 39 indexed repositories, 54 dependent packages, and quiet social channels point to a smaller direct footprint. Partial coverage of scoped packages leaves the number of teams choosing it uncertain.

  • npm downloadsLast4Weeks, downloadsSame4WeeksYearAgo, medianDownloadsRatio: Installs grew about 7.3× against a 4.1× catalog median.
  • dependents, github stars, peers: 39 indexed repositories and 1,633 stars, below Orval and openapi-typescript.
  • hackerNews stories, bluesky posts: Neither collector found a matching item.
  • github.com/honojs/middleware/blob/main/packages/zod-openapi/package.json: Installing Hono’s middleware can install this package transitively.
Vouched for5.8

Who stands behind it being good?

Claude Opus 5.5: 5.0, likely 3.5 to 6.5

Hono's official OpenAPI middleware builds on it, which is the strongest sign of quality. Independent write-ups compare it with zod-openapi and Zod's native output, but there is no survey data. I found no Hacker News or Bluesky posts, and no named production users.

GPT-6.2 Sol: 6.5, likely 5.3 to 7.6

Hono’s OpenAPI middleware builds on the package, and Polygon’s Apps team uses its registry in a Hey API plugin. Express developers also describe a practical workflow for sharing schemas between validation and documentation. These sources show that teams build on it, while project-specific satisfaction data and independent benchmarks remain sparse.

Safe8.0

How safe is it to depend on?

Claude Opus 5.5: 8.0, likely 7.0 to 9.0

It has no known advisories, one runtime dependency (openapi3-ts) and an MIT licence. Zod is a peer dependency, not a bundled one. There is no OpenSSF Scorecard and the release process is not documented, which keeps the score from going higher.

  • advisories total: 0 advisories.
  • npm dependencies: 1 runtime dependency.
  • scorecard: No Scorecard data.
  • npm license: MIT.

GPT-6.2 Sol: 7.9, likely 6.5 to 9.1

The package is MIT licensed, has one direct dependency plus Zod as a peer, and has zero advisories in the supplied OSV record. Its GitHub Actions workflow runs tests and publishes to npm with provenance. The missing Scorecard and security policy, concentrated release ownership, and an open report concerning untrusted schema definitions leave some uncertainty.

Good

  • It has generators for OpenAPI 3.0, 3.1 and 3.2, plus a registry for schemas, paths, webhooks and security components.
  • It supports Zod 4 and reads Zod's native .meta(), so simple cases need no extra API.
  • It pulls in only one runtime dependency, uses the MIT licence and has no known advisories.
  • Hono's official @hono/zod-openapi middleware uses it, which keeps it widely exercised.

Bad

  • It only works with Zod, and it covers only writing the spec; it does not make clients or docs itself.
  • The full .openapi() API means calling extendZodWithOpenApi to add a method to every Zod schema, which some teams avoid.
  • Zod 3 users are stuck on 7.3.4, which the maintainers no longer actively support.
  • samchungy/zod-openapi and Zod's own toJSONSchema now cover much of the same ground with less API surface.

The numbers

npm downloads, 4 weeks
32M ×7.3 in a year
GitHub stars
1.6k
Commits, 12 months
62
npm version
9.1.0 Jul 2026
Versions, 12 months
12
Advisories, 24 months
0 of 0 ever
OpenSSF Scorecard
None
Licence
MIT

Read on 21 November 2026 from GitHub (asteasolutions/zod-to-openapi), npm (@asteasolutions/zod-to-openapi), OSV and the OpenSSF Scorecard.

OpenAPI tools

  1. 8.1Scalar
  2. 7.7Orval
  3. 7.3Swagger UI
  4. 7.1Hey API
  5. 6.9Kubb
  6. 6.9zod-to-openapi
  7. 6.7Spectral
  8. 6.7Redoc
  9. 3.2openapi-typescript
Compare all 9 on six scores