Beta You're reading the docs for Kubb v5, which is currently in beta. View the stable v4 docs
Skip to content

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 and adapter to the equivalent support in every tool.

We keep this comparison accurate and fair. If you use one of these tools and think a row is wrong, open an issue or pull request in kubb-labs/kubb with notes or evidence.

Plugin and feature coverage

Legend

  • ✅ Built in and ready to use with no extra configuration.
  • 🟡 Supported through a third-party or community plugin.
  • 🔶 Supported and documented, but needs 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) 🔶2
React Query hooks 🛑
Vue Query composables 🛑
SWR hooks 🛑3 🟡4
Zod validation schemas 1 🛑
MSW request handlers 🛑 🛑
Faker.js mock data 🔶5 🛑 🛑
Cypress E2E tests 🛑 🛑 🛑
MCP server 🛑 🛑 🛑
Redoc API documentation 🛑 🛑 🛑
Barrel index files 🛑 🛑 🛑

Notes

  1. HeyAPI also generates Valibot schemas in addition to Zod.
  2. openapi-typescript generates types only. Its companion openapi-fetch runtime provides the typed client, so a client is not generated per operation. Note that openapi-fetch is in feature-freeze and is largely considered deprecated.
  3. HeyAPI lists SWR as a roadmap proposal that has not started yet.
  4. openapi-typescript relies on the community swr-openapi package, maintained outside the core project.
  5. orval does not emit a standalone Faker output, but it populates its MSW request handlers with faker-generated mock data.

What sets Kubb apart

Plugin architecture

Every output is a separate plugin, so you add only what you need. The plugins run against a shared AST. The spec is parsed once, and naming stays consistent across every output.

Custom adapters and parsers

A custom adapter swaps adapterOas for another input format such as AsyncAPI, GraphQL, or JSON Schema. A custom parser targets another output language such as Python, Kotlin, or Rust. Neither orval nor HeyAPI supports either one. Combine custom adapters, parsers, and plugins in one pipeline, and Kubb reaches inputs and outputs the others cannot.

Post-enforced plugins

Plugins with enforce: 'post' run after every regular plugin finishes. They handle cross-cutting work like barrel files and manifests without touching each plugin. @kubb/plugin-barrel works this way.

Bundler integration

unplugin-kubb runs generation inside 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.