Openapi Typescript Codegen

screenshot of Openapi Typescript Codegen
angular
express

NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification

Overview

The OpenAPI Typescript Codegen is an innovative tool designed for developers who prioritize TypeScript in their applications while working with OpenAPI specifications. It aims to eliminate the need for Java-based code generation, offering a lightweight yet robust solution for generating TypeScript clients across multiple frameworks. This tool is particularly beneficial for frontend developers who want to streamline their API interactions without the overhead of more traditional code generation methods.

With the recent announcement regarding the migration to @hey-api/openapi-ts, it’s clear that the future of this codegen tool is in capable hands. The ongoing commitment to maintain and enhance the functionality ensures that developers can continue to integrate seamlessly with modern frameworks while adhering to the latest OpenAPI specifications.

Features

  • Framework-Agnostic: This tool is designed to be lightweight and adaptable, ensuring it fits easily into any development environment without bias towards a particular framework.
  • Client Generation: Supports the automatic generation of TypeScript clients tailored for various methods such as Fetch, Node-Fetch, Axios, Angular, and XHR.
  • OpenAPI Support: Compatible with OpenAPI specifications v2.0 and v3.0, allowing developers to work with the latest standards in API documentation.
  • Versatile Input Formats: Accepts both JSON and YAML files, providing flexibility in how API specifications are structured and handled.
  • Multiple Usage Options: Can be executed through CLI, Node.js, or NPX, making it accessible for a variety of development workflows.
  • TypeScript Compatibility: Works seamlessly with tsc and the @babel/plugin-transform-typescript, integrating smoothly into TypeScript projects.
  • Cancelation Support: Implements a cancelable promise pattern to abort requests, enhancing user experience by providing control over ongoing API calls.
  • External References: Utilizes json-schema-ref-parser for managing external references, simplifying project structures.
angular
Angular

Angular is a TypeScript-based open-source framework by Google for building dynamic single-page applications and cross-platform mobile apps with MVC architecture and a rich set of features.

express
Express

Express.js is a simple Node.js framework for single, multi-page, and hybrid web applications.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

rollup
Rollup

RollupJS is a popular and efficient JavaScript module bundler that takes the code from multiple modules and packages them into a single optimized file, minimizing the overall size of the application and improving its performance.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.