In the DEV article “Which OpenAPI Codegen Should You Choose in 2026? 🤔 openapi-typescript vs Hey API vs Orval vs Kubb v5 🔥”, nyaomaru tested how generated TypeScript clients behave when an API returns an error or sends data that violates its schema. The original article is at https://dev.to/necoz/which-openapi-codegen-should-you-choose-in-2026-openapi-typescript-vs-hey-api-vs-orval-vs-kubb-m8c.
Check what an HTTP error does at the call site
The comparison uses a users endpoint that can return a normal list, a 400 response with a message, or a 409 response with conflict details. That fixture exposes a difference that a successful request can hide. In the tested Orval output, branching on the top-level status also narrows the type of the response body. The openapi-fetch and Hey API examples inspect a nested HTTP status and then check the error object's shape separately. Kubb v5 can narrow on status in its result mode, with a further check for an empty error body.
The query integration deserves its own test. In nyaomaru's Fetch setup, the tested Orval query resolved on HTTP 400 by default. The other tested query integrations rejected on that response. The distinction matters because a fulfilled promise can leave a query in its success state even when the server reported a bad request. The article shows an Orval Fetch configuration adjustment for that case. It also reports that Kubb rejected on a network failure even in the tested nonthrowing HTTP mode. Testing an HTTP error and testing a failed connection answer different questions.
Exercise the generated client with a small fixture
A team evaluating a generator can take one endpoint with two documented error bodies and run it through its actual query setup. Check which UI state appears for each status, then send an invalid success payload and see where it is rejected. The author's four default clients accepted invalid response data in the comparison. With runtime validation configured, all four rejected it. That distinction gives the team a concrete way to decide where validation belongs.
The generation benchmark used a synthetic specification with 1,200 operations. The comparison also measured TypeScript compilation separately, since regeneration time and type-checking time capture different costs. A small error-handling fixture can identify the client behavior a team wants before it repeats those timing measurements on its own schema.