Skip to content

Instantly share code, notes, and snippets.

View dcmorse's full-sized avatar

Dave Morse dcmorse

View GitHub Profile
@simenandre
simenandre / 0-runtypes-openapi-clients.md
Last active September 22, 2022 02:49
Generate clients based on Runtypes (and other awesome tech) from OpenAPI

OpenAPI 👉 Typescript / Runtypes / Rest Client

  • Status: proposed (not all options are fully evaluated)
  • Date: 2021-03-29

OpenAPI (formerly Swagger) is a way to describe a REST API. It has slowly become a business standard, used by large tech companies as well as small. The Open Source community has built the OpenAPI specification to improve the reliability of REST APIs, with it you can define types and methods of an API. The community has also built tools to generate server and client code for these APIs.

The benefits of code generators are obviously having to write less code. There are many alternatives to generate clients, based on OpenAPI – most of them have issues. The issues are typically unorganized source code, being unmaintaned, outdated targets (the generated Typescript code is outdated) or being unfinished. These issues are the fundation of this proposal, which is essentially rewriting/building a OpenAPI to Typescript client generator.

Context and Problem Statement