# zod-to-openapi: 6.9 out of 10

Reasonable, with limits. 6th of 9 in [OpenAPI tools](https://elestia.ai/opensource/openapi/index.md).

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.

## Scores

- **Overall: 6.9** (likely 5.8 to 7.9)
  - Claude Opus 5.5 (6.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): 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 many: 4.1** (likely 3.0 to 5.5)
  - Claude Opus 5.5 (4.0): 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): 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 lot: 7.3** (likely 6.2 to 8.3)
  - Claude Opus 5.5 (7.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): 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 time: 6.6** (likely 5.1 to 7.7)
  - Claude Opus 5.5 (6.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.
  - GPT-6.2 Sol (6.6): 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 widely: 5.3** (likely 3.7 to 6.6)
  - Claude Opus 5.5 (6.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): 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.
- **Vouched for: 5.8** (likely 4.4 to 7.1)
  - Claude Opus 5.5 (5.0): 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): 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.
- **Safe: 8.0** (likely 6.8 to 9.1)
  - Claude Opus 5.5 (8.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.
  - GPT-6.2 Sol (7.9): 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

- Downloads, 4 weeks: 32M
- In a year: ×7.3
- GitHub stars: 1.6k
- Commits, 12 months: 62
- Last npm release: Jul 2026
- Advisories, 24 months: 0
- Licence: MIT
- GitHub: https://github.com/asteasolutions/zod-to-openapi
- npm: https://www.npmjs.com/package/@asteasolutions/zod-to-openapi

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
