Which OpenAPI Codegen Should You Choose in 2026? π€ openapi-typescript vs Hey API vs Orval vs Kubb v5 π₯
nyaomaru on November 25, 2026
Hoi hoi!
I'm @nyaomaru, a frontend engineer who loves TypeScript, OSS, and getting lost in forests of generated code. π³
Six months ago, I compare...
Freelance fullstack developer creating fast, modern, and refined applications. I focus on simplicity, performance, and real value for users. I also write tech-related articles here.
Great practical comparison! Framing the choice around operational trade-offs like file count, IDE indexing, and error models instead of just feature checklists is what actually matters once an API grows past a few hundred operations.
The distinction between a lightweight type generator like openapi-typescript and fuller platforms like Orval or Kubb is spot on. For larger codebases, having a consistent { path, query, body } signature and a predictable result-style error model like hey-api offers really pays off over shorter per-endpoint call sites.
Full-stack software engineer with 8+ years of experience in Python, JavaScript, TypeScript, APIs, and PostgreSQL. Passionate about building reliable software and connecting with fellow developers.
Great comparison! I appreciate how you've brought these different OpenAPI code generation tools together.
One thing I'm particularly curious about is long-term maintainability in large projects. When multiple backend teams frequently update their API specifications, generated code changes can become difficult to manage.
Which of these tools would you recommend for a large microservices architecture? And how would you handle breaking API changes automatically within a CI/CD pipeline without disrupting existing frontend applications?
I'd love to hear your perspective on this. Thanks for sharing such a useful comparison! π
I can only speak confidently about Hey API from production experience, as I haven't used Kubb in a real project yet. πΈ
In my current project, I set up an automated workflow like this:
When the backend changes, the OpenAPI YAML is automatically generated.
Hey API generates the clients and types from that specification.
If the generated code contains changes, PRs are automatically created in the relevant frontend repositories.
This works across multiple backend services and frontend repositories, and so far, we haven't encountered any major issues. It's incredibly convenient! π
For breaking API changes, I would separate automatic code generation from automatic merging. Type checking, tests, and builds in the frontend CI pipeline can help catch incompatible changes before they reach production.
Of course, breaking changes still require coordination between backend and frontend teams.
So, based on my production experience, I'd confidently recommend Hey API for a microservices architecture. π
As for Kubb v5, I can't yet make the same claim about its long-term maintainability in production.
However, based on this investigation, I think it's absolutely worth considering, especially if you want to standardize code generation across multiple teams and projects through shared plugins and conventions.
Full-stack software engineer with 8+ years of experience in Python, JavaScript, TypeScript, APIs, and PostgreSQL. Passionate about building reliable software and connecting with fellow developers.
Thanks for sharing your production experience! I really like your approach of separating automated code generation from automatic merging.
That brings up another interesting question. How do you detect breaking API changes that don't necessarily cause TypeScript compilation errors, such as changes in response behavior, validation rules, or business logic? Do you also use contract testing alongside your CI/CD pipeline to catch these issues?
I'd love to hear how your team handles this in practice. Really appreciate the discussion! π
These kinds of behavioral changes are much harder to detect through type checking or code generation alone.
In our current workflow, we run an AI-powered code review on the automatically generated PRs in the frontend repositories. This helps us identify potential compatibility issues that TypeScript might not catch.
Of course, AI review isn't a guarantee, especially when business logic changes aren't reflected in the API specification. Human review and communication between backend and frontend teams are still important.
It's not a perfect solution, but it's a useful additional layer! π
Full-stack software engineer with 8+ years of experience in Python, JavaScript, TypeScript, APIs, and PostgreSQL. Passionate about building reliable software and connecting with fellow developers.
That's a really interesting approach! I appreciate your transparency about the limitations of AI-powered code reviews. Combining AI assistance with human expertise seems like a practical balance.
One question that comes to mind: if the AI reviewer only receives the generated frontend code changes, how does it detect behavioral changes in the backend that aren't reflected in the OpenAPI specification? Have you considered providing the AI reviewer with backend implementation changes as additional context?
I think this could be particularly valuable for complex microservices where a seemingly minor backend change can have unexpected downstream effects.
Really enjoying this technical discussion. Thanks for sharing your experience! π
That's actually what we're doing. Our AI reviewer checks the backend implementation as well, rather than relying solely on the generated frontend code or OpenAPI specification.
This gives it more context to identify potential downstream impacts that aren't visible in the schema alone. π
The network-failure row is the comparison I would keep next to the generated client. It is easy to read nonthrowing mode as a promise about the whole call. A tiny shared fixture with an HTTP error, an empty error body and a broken connection would be a useful regression check whenever the generator gets upgraded.
Nonthrowing mode doesn't necessarily mean the entire call is safe from exceptions.
Personally, I think a well-designed type system can prevent many of these issues by making callers handle the possible outcomes explicitly, although network failures still need careful runtime handling. πΊ
type NullEnum = never is scarier than it looks, because a never inside a union just disappears. A field generated as string | NullEnum becomes plain string, the nullable case is gone, and the compiler is perfectly happy about it. That's the kind of regression you only catch by reading generated output, so a handful of type-level assertions on known tricky schemas (expectTypeOf or a tsd file) seem worth running after every generator upgrade. Have you thought about publishing the fixtures from this comparison as a small suite people could point their own setup at?
Exactly! That's what makes this edge case particularly tricky. πΈ
I've already opened an issue for it, and if it remains unresolved, I might try fixing it myself!
Rather than maintaining a separate regression suite, I'd prefer to contribute these edge cases and regression tests directly to the respective libraries. That way, everyone benefits from the fixes. π
I research AI tools, APIs & agents β comparing specs, pricing and real user reports β then publish honest rankings so you don't waste money. Research-first, never sponsored fluff.
The rename test is the table I'd actually decide on β one operationId renamed and Kubb touches 6 files and 118 changed lines, Hey API touches 3 files and 18. The 2,897-file forest looks fine until a rename lands in a real PR. Do reviewers just start rubber-stamping generated diffs at that size, or does the per-file smallness actually make review easier?
I don't think every generated diff needs to be reviewed manually. Ideally, CI catches most breaking changes in types and data shapes, and we focus human review on the changes that need attention.
Personally, I find files separated by responsibility easier to review, but too much fragmentation can make navigation harder too.
It's all about finding the right balance rather than simply minimizing the file count! π
Love that you came back six months later. These tools move so fast that most comparison posts are stale by the time anyone finds them.
Biggest lesson for me: the generator matters less than the spec. Inconsistent operationIds and inline schemas everywhere make every generator look bad. Clean, spec-first contracts make even the simple ones shine. That spec-first mindset is a big part of what we teach in Grokking the API Design Interview at DesignGurus.
Kubb v5's plugin setup does look tempting though...
Technology moves incredibly fast, especially in the AI era. It's really interesting to revisit these tools every few months and see how much has changed!
And I totally agree that a well-designed API specification is the foundation of good code generation. π
Most comparisons stop at generation speed, so I appreciated that you also measured TypeScript compile time (about 2.44s for Hey API vs 3.80s for Kubb). That's the cost developers feel every day in the IDE and in CI, and the generation numbers hide it.
The TanStack Query finding was the most useful part for me. Orval resolving on an HTTP 400 by default is the kind of silent failure that only shows up in production, so it's worth a line in everyone's setup checklist (forceSuccessResponse: true).
The operationId rename test (+2/β2 for openapi-typescript vs +59/β59 across 6 files for Kubb) also made me think about review overhead. Do you have a sense of whether Kubb's distributed output makes PR diffs on regenerated code noisier in practice, or does the per-file split make them easier to skim?
Thanks for testing the edge cases like the null-only enum instead of trusting the happy path.
Personally, I prefer smaller, more consolidated diffs. Having fewer files to navigate and fewer cross-file dependencies to trace makes reviewing changes much easier for me. π
That said, I haven't used Kubb v5 in production yet, so I'd love to see how this plays out in practice! πΈ
SiGa Systems helps businesses turn complex ideas into practical digital solutions through custom software development, web applications, AI automation, and website development.
Really useful comparison, especially the focus on maintainability as APIs grow. One important consideration in larger applications is keeping frontend and backend contracts consistent as endpoints and schemas evolve.
I also like the point about using shared code generation rules instead of letting every project or developer create different API patterns. That can make a real difference in reducing inconsistencies and keeping development workflows manageable.
Great breakdown of the practical trade-offs between these tools
Exactly! Especially now that AI can generate code so quickly, I think having shared conventions and a consistent foundation across projects is more valuable than ever.
I'd rather automate consistency than repeatedly fix inconsistencies! πΉ
Great practical comparison! Framing the choice around operational trade-offs like file count, IDE indexing, and error models instead of just feature checklists is what actually matters once an API grows past a few hundred operations.
The distinction between a lightweight type generator like
openapi-typescriptand fuller platforms like Orval or Kubb is spot on. For larger codebases, having a consistent{ path, query, body }signature and a predictable result-style error model likehey-apioffers really pays off over shorter per-endpoint call sites.Thanks, John!! πΈπ
Exactly! Once you have hundreds of endpoints, consistency matters much more than saving a few lines of code.
That's one of the reasons I've been so comfortable with
Hey APIin production.But
Kubbv5 is making me curious again! πΉGreat comparison! I appreciate how you've brought these different OpenAPI code generation tools together.
One thing I'm particularly curious about is long-term maintainability in large projects. When multiple backend teams frequently update their API specifications, generated code changes can become difficult to manage.
Which of these tools would you recommend for a large microservices architecture? And how would you handle breaking API changes automatically within a CI/CD pipeline without disrupting existing frontend applications?
I'd love to hear your perspective on this. Thanks for sharing such a useful comparison! π
Thanks for the great question! π
I can only speak confidently about
Hey APIfrom production experience, as I haven't usedKubbin a real project yet. πΈIn my current project, I set up an automated workflow like this:
Hey APIgenerates the clients and types from that specification.This works across multiple backend services and frontend repositories, and so far, we haven't encountered any major issues. It's incredibly convenient! π
For breaking API changes, I would separate automatic code generation from automatic merging. Type checking, tests, and builds in the frontend CI pipeline can help catch incompatible changes before they reach production.
Of course, breaking changes still require coordination between backend and frontend teams.
So, based on my production experience, I'd confidently recommend
Hey APIfor a microservices architecture. πAs for
Kubbv5, I can't yet make the same claim about its long-term maintainability in production.However, based on this investigation, I think it's absolutely worth considering, especially if you want to standardize code generation across multiple teams and projects through shared plugins and conventions.
I'm quite excited about its potential! πΈ
Thanks for sharing your production experience! I really like your approach of separating automated code generation from automatic merging.
That brings up another interesting question. How do you detect breaking API changes that don't necessarily cause TypeScript compilation errors, such as changes in response behavior, validation rules, or business logic? Do you also use contract testing alongside your CI/CD pipeline to catch these issues?
I'd love to hear how your team handles this in practice. Really appreciate the discussion! π
These kinds of behavioral changes are much harder to detect through type checking or code generation alone.
In our current workflow, we run an AI-powered code review on the automatically generated PRs in the frontend repositories. This helps us identify potential compatibility issues that TypeScript might not catch.
Of course, AI review isn't a guarantee, especially when business logic changes aren't reflected in the API specification. Human review and communication between backend and frontend teams are still important.
It's not a perfect solution, but it's a useful additional layer! π
That's a really interesting approach! I appreciate your transparency about the limitations of AI-powered code reviews. Combining AI assistance with human expertise seems like a practical balance.
One question that comes to mind: if the AI reviewer only receives the generated frontend code changes, how does it detect behavioral changes in the backend that aren't reflected in the OpenAPI specification? Have you considered providing the AI reviewer with backend implementation changes as additional context?
I think this could be particularly valuable for complex microservices where a seemingly minor backend change can have unexpected downstream effects.
Really enjoying this technical discussion. Thanks for sharing your experience! π
Exactly! πΈ
That's actually what we're doing. Our AI reviewer checks the backend implementation as well, rather than relying solely on the generated frontend code or OpenAPI specification.
This gives it more context to identify potential downstream impacts that aren't visible in the schema alone. π
The network-failure row is the comparison I would keep next to the generated client. It is easy to read nonthrowing mode as a promise about the whole call. A tiny shared fixture with an HTTP error, an empty error body and a broken connection would be a useful regression check whenever the generator gets upgraded.
Good point, Emily! πΈπ
Nonthrowing mode doesn't necessarily mean the entire call is safe from exceptions.
Personally, I think a well-designed type system can prevent many of these issues by making callers handle the possible outcomes explicitly, although network failures still need careful runtime handling. πΊ
type NullEnum = neveris scarier than it looks, because a never inside a union just disappears. A field generated asstring | NullEnumbecomes plainstring, the nullable case is gone, and the compiler is perfectly happy about it. That's the kind of regression you only catch by reading generated output, so a handful of type-level assertions on known tricky schemas (expectTypeOf or a tsd file) seem worth running after every generator upgrade. Have you thought about publishing the fixtures from this comparison as a small suite people could point their own setup at?Exactly! That's what makes this edge case particularly tricky. πΈ
I've already opened an issue for it, and if it remains unresolved, I might try fixing it myself!
Rather than maintaining a separate regression suite, I'd prefer to contribute these edge cases and regression tests directly to the respective libraries. That way, everyone benefits from the fixes. π
The rename test is the table I'd actually decide on β one operationId renamed and Kubb touches 6 files and 118 changed lines, Hey API touches 3 files and 18. The 2,897-file forest looks fine until a rename lands in a real PR. Do reviewers just start rubber-stamping generated diffs at that size, or does the per-file smallness actually make review easier?
Great question, Paul! πΈ
I don't think every generated diff needs to be reviewed manually. Ideally, CI catches most breaking changes in types and data shapes, and we focus human review on the changes that need attention.
Personally, I find files separated by responsibility easier to review, but too much fragmentation can make navigation harder too.
It's all about finding the right balance rather than simply minimizing the file count! π
Love that you came back six months later. These tools move so fast that most comparison posts are stale by the time anyone finds them.
Biggest lesson for me: the generator matters less than the spec. Inconsistent operationIds and inline schemas everywhere make every generator look bad. Clean, spec-first contracts make even the simple ones shine. That spec-first mindset is a big part of what we teach in Grokking the API Design Interview at DesignGurus.
Kubb v5's plugin setup does look tempting though...
Thanks, Arslan! πΈπ
Technology moves incredibly fast, especially in the AI era. It's really interesting to revisit these tools every few months and see how much has changed!
And I totally agree that a well-designed API specification is the foundation of good code generation. π
Most comparisons stop at generation speed, so I appreciated that you also measured TypeScript compile time (about 2.44s for Hey API vs 3.80s for Kubb). That's the cost developers feel every day in the IDE and in CI, and the generation numbers hide it.
The TanStack Query finding was the most useful part for me. Orval resolving on an HTTP 400 by default is the kind of silent failure that only shows up in production, so it's worth a line in everyone's setup checklist (
forceSuccessResponse: true).The
operationIdrename test (+2/β2 for openapi-typescript vs +59/β59 across 6 files for Kubb) also made me think about review overhead. Do you have a sense of whether Kubb's distributed output makes PR diffs on regenerated code noisier in practice, or does the per-file split make them easier to skim?Thanks for testing the edge cases like the null-only enum instead of trusting the happy path.
Thanks for the thoughtful feedback! πΈπ
Personally, I prefer smaller, more consolidated diffs. Having fewer files to navigate and fewer cross-file dependencies to trace makes reviewing changes much easier for me. π
That said, I haven't used Kubb v5 in production yet, so I'd love to see how this plays out in practice! πΈ
Really useful comparison, especially the focus on maintainability as APIs grow. One important consideration in larger applications is keeping frontend and backend contracts consistent as endpoints and schemas evolve.
I also like the point about using shared code generation rules instead of letting every project or developer create different API patterns. That can make a real difference in reducing inconsistencies and keeping development workflows manageable.
Great breakdown of the practical trade-offs between these tools
Thank you! πΈπ
Exactly! Especially now that AI can generate code so quickly, I think having shared conventions and a consistent foundation across projects is more valuable than ever.
I'd rather automate consistency than repeatedly fix inconsistencies! πΉ
I found the rename test especially useful because it showed me the real cost of a small change.
Thank you! πΈπ
I'm glad to hear that! π