# hey-api/openapi-ts

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/hey-api-openapi-ts).**

4,128 stars · 315 forks · TypeScript · mit

## Links

- GitHub: https://github.com/hey-api/openapi-ts
- Homepage: https://heyapi.dev
- awesome-repositories: https://awesome-repositories.com/repository/hey-api-openapi-ts.md

## Topics

`angular` `axios` `codegen` `fetch` `generator` `http` `javascript` `nextjs` `nodejs` `nuxt` `nuxt3` `openapi` `openapi3` `openapi31` `rest` `swagger` `typescript`

## Description

openapi-ts is a tool and orchestrator used to convert OpenAPI specifications into type-safe TypeScript SDKs and HTTP client implementations. It automatically generates typed interfaces and request functions from API definitions to ensure consistency between the server and the client.

The project employs a transport-agnostic client interface, decoupling high-level API calls from the underlying network library. It uses a plugin-based generation pipeline and a custom plugin architecture to allow for the customization of output types and validation schemas.

The system provides capabilities for network layer abstraction and traffic interception through middleware. It also includes support for request cancellation to manage network lifecycles and maps JSON schema definitions to static TypeScript types.

## Tags

### Web Development

- [Type-Safe Client Generators](https://awesome-repositories.com/f/web-development/api-client-generators/type-safe-client-generators.md) — Automatically generates type-safe TypeScript SDKs and interfaces from OpenAPI specifications. ([source](https://cdn.jsdelivr.net/gh/hey-api/openapi-ts@main/README.md))
- [HTTP Request Clients](https://awesome-repositories.com/f/web-development/http-request-clients.md) — Automates the creation of SDKs from API schemas to replace manual writing of request functions.
- [Type-Safe API Integrations](https://awesome-repositories.com/f/web-development/type-safe-api-integrations.md) — Synchronizes data schemas between client and server using OpenAPI specifications to ensure full TypeScript support.
- [Request Interception Middleware](https://awesome-repositories.com/f/web-development/request-interception-middleware.md) — Provides middleware pipeline handlers to intercept and modify outgoing requests and incoming responses. ([source](https://cdn.jsdelivr.net/gh/hey-api/openapi-ts@main/README.md))

### Development Tools & Productivity

- [OpenAPI Client SDK Generators](https://awesome-repositories.com/f/development-tools-productivity/openapi-client-sdk-generators.md) — Produces compatible client code and schema enums based on local or remote OpenAPI specifications.
- [API Specification Importers](https://awesome-repositories.com/f/development-tools-productivity/project-imports/external-file-importers/api-specification-importers.md) — Supports loading OpenAPI definitions from local files, remote URLs, or registries to drive client generation. ([source](https://heyapi.dev))
- [Schema-Driven Code Generators](https://awesome-repositories.com/f/development-tools-productivity/project-scaffolding-config-code-generation/code-generation/schema-driven-code-generators.md) — Transforms OpenAPI specifications into TypeScript type definitions and client interfaces via an automated build process.

### Networking & Communication

- [Pluggable Transport Layers](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/communication-protocols-standards/network-transport-layers/pluggable-transport-layers.md) — Decouples high-level API calls from network libraries using a swappable transport layer implementation.
- [HTTP Abstraction Layers](https://awesome-repositories.com/f/networking-communication/http-abstraction-layers.md) — Encapsulates low-level network objects to provide a consistent high-level API across different runtimes.
- [Transport Abstractions](https://awesome-repositories.com/f/networking-communication/api-integration-frameworks/http-client-libraries/http-client-configurations/transport-abstractions.md) — Provides a transport-agnostic client interface that decouples API calls from the underlying network library.
- [Runtime Compatibility Layers](https://awesome-repositories.com/f/networking-communication/api-integration-frameworks/http-client-libraries/runtime-compatibility-layers.md) — Produces client code compatible with various networking libraries and web frameworks for cross-environment execution. ([source](https://heyapi.dev))
- [Middleware-Based Request Pipelines](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/request-processing-architectures/request-processing/middleware-based-request-pipelines.md) — Implements a modular chain of pluggable components to intercept and process network requests and responses.
- [HTTP Transport Configurations](https://awesome-repositories.com/f/networking-communication/http-transport-configurations.md) — Allows customizing the network layer by selecting specific libraries or native browser interfaces for different environments. ([source](https://cdn.jsdelivr.net/gh/hey-api/openapi-ts@main/README.md))
- [Request Cancellations](https://awesome-repositories.com/f/networking-communication/network-request-clients/request-cancellations.md) — Implements a cancellable promise pattern to abort active network requests and save bandwidth. ([source](https://cdn.jsdelivr.net/gh/hey-api/openapi-ts@main/README.md))

### Software Engineering & Architecture

- [API Client Generators](https://awesome-repositories.com/f/software-engineering-architecture/api-client-generators.md) — Converts API definitions into typed interfaces and request functions to ensure server-client consistency.
- [TypeScript Type Synthesis](https://awesome-repositories.com/f/software-engineering-architecture/typescript-type-definitions/static-type-checking/typescript-type-synthesis.md) — Automatically synthesizes static TypeScript interfaces from JSON schema definitions.
- [Plugin Extenders](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/extensibility/plugin-architectures/developer-authoring-interfaces/custom-module-implementations/module-functionality-extenders/plugin-extenders.md) — Enables extending functionality through custom plugins that interact with internal system interfaces. ([source](https://heyapi.dev))
- [Request Middleware](https://awesome-repositories.com/f/software-engineering-architecture/request-middleware.md) — Sets up interceptors to handle cross-cutting concerns like authentication headers and activity logging.
- [Generation Pipeline Customization](https://awesome-repositories.com/f/software-engineering-architecture/schema-to-code-generators/generation-pipeline-customization.md) — Provides control over generated output by composing plugins to include specific types and validation schemas. ([source](https://heyapi.dev))
- [Plugin-Based Architectures](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/plugin-module-systems/modular-plugin-architectures/plugin-based-architectures/plugin-based-architectures.md) — Uses a plugin-based architecture to allow customization of output types and validation schemas during generation.
