Generate idiomatic TypeScript clients from OpenAPI: complete guide (September 2026)
Blog post from Fern
Generating a useful TypeScript client from OpenAPI depends less on a tool’s feature list than on its defaults for naming, serialization, union narrowing, optionality, typed errors, module formats, runtime compatibility, and dependencies. The source OpenAPI specification should include clear operation IDs, consistent tags, accurate required-versus-nullable fields, formats, examples, and `oneOf` schemas with discriminators so generated types are understandable and narrow correctly. The text contrasts tools intended for internal applications, such as openapi-typescript, Orval, Hey API, and Kubb, with tools for published SDKs, including OpenAPI Generator, Kiota, Speakeasy, and Fern, arguing that public packages require stronger compatibility, testing, publishing, and dependency considerations. It examines tradeoffs between wire-format-preserving clients and casing-transforming serialization layers, thrown typed errors and result objects, closed and open enums, branded identifiers, and optional properties versus explicit undefined values. It also recommends native fetch, ESM and CommonJS support, minimal runtime dependencies, configurable retries and timeouts, built-in pagination and streaming support, regeneration-safe extension patterns, and CI-based generation, tests, compatibility checks, and trusted npm publishing. Fern is presented as a generator that exposes many of these choices through configuration while offering dependency-free output, generated tests, pagination, retries, middleware, and OpenAPI export.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| Real-time | 3 | 4,839 | 1,083 | 239 | +4% |
| Edge Computing | 1 | 89 | 31 | 11 | +170% |
| Secrets Management | 1 | 2,045 | 503 | 138 | -11% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.