openapi-chain

Overview

A type-safe OpenAPI client for complex and large APIs, whose requests follow the document's wire rules exactly.

openapi-chain compiles the serialization rules an OpenAPI document declares (parameter style, explode, allowReserved and content, request media types, and form and multipart Encoding Objects) and applies them to every request. A build-time CLI generates types and metadata scoped to the paths you call. Calls use a fluent path API with no generated endpoint code and no runtime dependencies.

Start here

Choose a client

NeedEntry pointRuntime schema
Fluent typed calls with schema-free serialization defaultsopenapi-chain → createClientNone
OpenAPI parameter styles, structured forms or multipart encodingopenapi-chain/strict → createStrictClientCompiled metadata
Keep openapi-fetch calls with the strict serializeropenapi-chain/openapi-fetch → withOpenAPISerializationCompiled metadata
Compile serialization metadata from an OpenAPI documentopenapi-chain/metadata → compileOpenAPIMetadataOpenAPI 3.0, 3.1 or 3.2 object

Evidence before claims

The wire comparison executes 20 OpenAPI declarations through openapi-chain and openapi-fetch, and performance records size, request overhead and type-checking cost on synthetic fixtures and the pinned GitHub and Stripe documents.

Reference

Packages

PackageRole
openapi-chainRuntime: schema-free core, strict client, metadata compiler and openapi-fetch adapter
@openapi-chain/cliNode-only build-time generation of declarations, scopes and metadata
@openapi-chain/queryExplicit operation query keys and fetchers for TanStack Query and SWR

These pages are generated from the repository's Markdown documentation. Each page links to its source on GitHub; see contributing to propose a change.

On this page