Kubb vs orval, HeyAPI, and openapi-typescript
Kubb, orval, HeyAPI, and openapi-typescript all generate code from OpenAPI specs. The table below maps each Kubb plugin, middleware, and adapter to the equivalent support in every tool.
This comparison strives to be as accurate and unbiased as possible. If you use any of these tools and believe a row could be improved, suggest a change (with notes or evidence) through the Edit this page link at the bottom.
Plugin and feature coverage
Legend
- ✅ First-class, built-in, and ready to use with no added configuration.
- 🟡 Supported through a third-party or community plugin.
- 🔶 Supported and documented, but requires extra user code.
- 🛑 Not officially supported or documented.
| Feature | Kubb | orval | HeyAPI | openapi-ts |
|---|---|---|---|---|
| OpenAPI 2.0, 3.0, 3.1 input | ✅ | ✅ | ✅ | ✅ |
| TypeScript types | ✅ | ✅ | ✅ | ✅ |
| HTTP client (Axios, Fetch) | ✅ | ✅ | ✅ | 🔶3 |
| React Query hooks | ✅1 | ✅ | ✅1 | 🛑 |
| Vue Query composables | ✅1 | ✅ | ✅1 | 🛑 |
| Zod validation schemas | ✅ | ✅ | ✅2 | 🛑 |
| MSW request handlers | ✅ | ✅ | 🛑 | 🛑 |
| Faker.js mock data | ✅ | 🛑 | 🛑 | 🛑 |
| Cypress E2E tests | ✅ | 🛑 | 🛑 | 🛑 |
| MCP server | ✅ | 🛑 | 🛑 | 🛑 |
| Redoc API documentation | ✅ | 🛑 | 🛑 | 🛑 |
| Barrel index files | ✅ | 🛑 | 🛑 | 🛑 |
Notes
- React Query and Vue Query parameter handling. Kubb types the path and query parameters guarded by
enabledas optional and emits theenabledguard, so you can pass a value that is not ready yet (a route parameter or the result of a dependent query) and the query stays disabled until it resolves. HeyAPI keeps those parameters required and does not emit anenabledguard, leaving conditional fetching to you. - HeyAPI also generates Valibot schemas in addition to Zod.
- openapi-typescript generates types only. Its companion
openapi-fetchruntime provides the typed client, so a client is not generated per operation.
What sets Kubb apart
Plugin architecture
Every output is a separate plugin. You add only what you need. All plugins run against a shared AST, so the spec is parsed once and naming stays consistent across every output.
Custom adapters and parsers
Custom adapters let you swap adapterOas for any input format: AsyncAPI, GraphQL, or JSON Schema. Custom parsers let you target any output language: Python, Kotlin, Rust, or other. Neither orval nor HeyAPI supports either. Because you can combine custom adapters, parsers, plugins, and middlewares in one pipeline, Kubb covers a broader range of inputs and outputs.
Middleware layer
The middleware layer runs after all plugins finish and handles cross-cutting concerns like barrel files and manifests without modifying each plugin individually.
Bundler integration
unplugin-kubb integrates generation into Vite, Rollup, Rolldown, Webpack, Rspack, esbuild, Farm, Nuxt, and Astro. HeyAPI ships a Vite-only plugin; orval has no bundler integration.
When not to use Kubb
- You consume only a few endpoints that rarely change.
- You do not have an OpenAPI spec and do not plan to write one.
- You need codegen for a non-OpenAPI format today and do not want to write a custom adapter.