Skip to content

About openapi-typescript

Used by

  • Bigcommerce: Node SDK for the BigCommerce API
  • Budibase: low code platform for creating internal tools, workflows, and admin panels
  • Fedora fmn: tools and APIs for Fedora’s messaging infra
  • Fingerprint: device fingerprinting for high-scale applications
  • Google Firebase CLI: Official CLI for Google’s Firebase platform
  • GitHub Octokit: Official SDK for the GitHub API
  • Lotus: open source pricing & packaging infra
  • Jitsu: modern, open source data ingestion / data pipelines
  • Medusa: building blocks for digital commerce
  • Netlify: the modern development platform
  • Nuxt: The Intuitive Vue framework
  • Relevance AI: build and deploy AI chains
  • Revolt: open source user-first chat platform
  • Spacebar: a free, open source, self-hostable Discord-compatible chat/voice/video platform
  • Supabase: The open source Firebase alternative.

Project goals

  1. Support converting any valid OpenAPI schema to TypeScript types, no matter how complicated.
  2. Generated types should be statically-analyzable and runtime-free (with minor exceptions like enums.
  3. Don’t validate schemas; there are existing libraries for that like Redocly.
  4. Generated types should match your original schema as closely as possible, preserving original capitalization, etc.
  5. Typegen only needs Node.js to run (no Java, Python, etc.) and works in any environment.
  6. Support fetching OpenAPI schemas from files as well as local and remote servers.

Differences

vs. swagger-codegen

openapi-typescript was created specifically to be a lighterweight, easier-to-use alternative to swagger-codegen that doesn’t require the Java runtime or running an OpenAPI server. Nor does it generate heavyweight clientside code. In fact, all the code openapi-typescript generates is runtime free static types for maximum performance and minimum client weight.

vs. openapi-typescript-codegen

These 2 projects are unrelated. openapi-typescript-codegen is a Node.js alternative to the original swagger-codegen, but ends up being the same in practice. openapi-typescript has the same advantage of being runtime free whereas openapi-typescript-codegen can generate some pretty heavy bundles, up to 250 kB or more depending on the schema complexity.

vs. tRPC

tRPC is an opinionated type-safe framework for both server and client. It demands both your server and client be written in tRPC (which means Node.js for the backend).

If you fit into this usecase, it’s a great experience! But for everyone else, openapi-typescript (and openapi-fetch) is a more flexible, lower-level solution that can work for any technology choice (or even be incrementally-adopted without any cost).

Maintainers

This library is currently maintained by these amazing individuals:

Drew Powers

Drew Powers

Lead, Creator openapi-typescript/openapi-fetch

Martin Paucot

Martin Paucot

Core Contributor, Creator openapi-react-query

Tobias Schlatter

Tobias Schlatter

Core Contributor

Hunter Tunnicliff

Hunter Tunnicliff

Core Contributor, Creator swr-openapi

Duncan Beevers

Duncan Beevers

Core Contributor

Contributors

And thanks to 100+ amazing contributors, without whom these projects wouldn’t be possible:

  • Przemek Smyrdek
  • Dan Enman
  • Atle Frenvik Sveen
  • Tim de Wolf
  • Tom Barton
  • Sven Nicolai Viig
  • Sorin Davidoi
  • Nathan Schneirov
  • Lucien Bénié
  • Boris
  • Anton Kastritskii
  • Tim Shelburne
  • Michał Miszczyszyn
  • Sam K Hall
  • Matt Jeanes
  • Kristofer Giltvedt Selbekk
  • Elliana May
  • Henrik Hall
  • Gregor Martynus
  • Sam Mesterton-Gibbons
  • Rendall
  • Robert Massaioli
  • Jan Kuča
  • Thomas Valadez
  • Asitha de Silva
  • Misha
  • Alex Batalov
  • Federico Bevione
  • Daisuke Yamamoto
  • Ash Smith
  • Micah Halter
  • chrg1001
  • Dakshraj Sharma
  • Shaosu Liu
  • Vytenis
  • Eric Zorn
  • Max Belsky
  • Peter Bech
  • Rusty Conover
  • Dave Carlson
  • Artem Shuvaev
  • Dominik Dosoudil
  • kgtkr
  • philip trauner
  • Pavel Yermolin
  • Timofei Kukushkin
  • Dmitry Semigradsky
  • Jeremy Liberman
  • Axel Hernández Ferrera
  • Loïc Fürhoff
  • Bartosz Szczeciński
  • Marco Salomone
  • Yacine Hmito
  • Sajad Torkamani
  • Marius van den Beek
  • Steven Grimm
  • Erik Hughes
  • Matthieu Monsch
  • Mitchell Merry
  • François Risoud
  • liangsky
  • Don Denton
  • Yad Smood
  • barak
  • Lukáš Horák
  • Andrea Carraro
  • psychedelicious
  • Tanguy Krotoff
  • Pim Veldhuisen
  • Aleksandr Vishniakov
  • Ahsan Fazal
  • Eugene Dzhumak
  • Mohammed Gadi
  • Adam K
  • Christoph Fricke
  • Jorrin
  • Nick Williams
  • hrsh7th
  • Hongkun
  • Matthias Zronek
  • Łukasz Wiśniewski
  • Jean-Rémi Delteil
  • Tzvi Melamed
  • ehrenschwan
  • Niccolo Zapponi
  • Marvin Luchs
  • Neil MacMunn
  • Nadeem Bitar
  • Emory Petermann
  • yoshi2no
  • Tyler Fletcher
  • Nicklos Holik
  • Nikita Gusakov
  • Stéphane Codazzi
  • Michał Fedyna
  • Matthew Lieder
  • Nick Caballero
  • Tang Ziya
  • Yuku Kotani
  • Hadrian de Oliveira
  • zaru
  • Percy Ma
  • Marco Muser
  • Evgenii Perminov
  • alex
  • Lev Chelyadinov
  • Free 公園
  • jimmy
  • hungify
  • Jared Lunde
  • Armand Abric
  • Trevor Fitzgerald
  • Jonathan Morales Vélez
  • Mike Darwish
  • Mehdi
  • Valentin Agachi
  • moyaojun
  • Dan Michael O. Heggø
  • Fred Silberberg
  • Viljami
  • Felix Kaechele
  • Sebastien Guillemot
  • Morley Tatro
  • Nick Graef
  • Valerij Medviď
  • Bruno Carneiro
  • Mike Stop Continues
  • maurice
  • Ville Penttinen
  • Jiří Staniševský
  • Brad Harker
  • Konstantin Barabanov
  • Hong Seungwoo
  • yicrotkd
  • Makoto Tateno
  • Tomohiro Ishii
  • Blake
  • Elay Gelbart
  • Djordy Koert
  • Jo M
  • Oskar Thornblad
  • Sultan Iman
  • Patryk Tomczyk
  • Marco Ellwanger
  • mochi33i
  • Laurenz Glück
  • Guillaume Duliscouët
  • Ali Kehel
  • Chai Landau
  • Benno
  • Hagen
  • Jungwoo LEE
  • Gianmarco Rengucci
  • Lucas Eduardo
  • Viktor Pöntinen
  • Kevin Wang