Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

openapi-nexus is a modular OpenAPI 3.1 code generator written in Rust. It reads an OpenAPI specification and produces type-safe client libraries for multiple languages.

Supported Languages

LanguageGenerator IDStatus
TypeScript (fetch)typescript-fetchStable
Go (net/http)go-httpStable

How It Works

openapi-nexus follows a compiler-like pipeline:

OpenAPI YAML / JSONParse (auto-detect OAS3.0 / 3.1)Lower to IR (IrSpec)CodeGenerator::generate(&IrSpec)Vec<FileInfo> →write to disk

Parsing and lowering happen once in the orchestrator. Each generator receives a pre-lowered IrSpec and produces a list of files. Generators use sigil-stitch for type-safe, import-aware code emission.

Key Properties

  • Deterministic output. The same spec always produces the same files. Golden tests enforce byte-for-byte reproducibility.
  • Compile-checked output. CI runs tsc --noEmit on every generated TypeScript file and go build ./... on every generated Go file.
  • Single binary. The CLI is a self-contained Rust binary with no runtime dependencies.