OpenAPI Nexus
OpenAPI 3.0 / 3.1 / 3.2 to multi-language code generator
OpenAPI Nexus transforms OpenAPI specifications into type-safe client libraries. Generated output is deterministic, compile-checked in CI, and tested byte-for-byte via golden tests.
Language Support
| Language | Generator | HTTP Client | Status |
|---|---|---|---|
| TypeScript | typescript-fetch |
fetch | Beta |
| Go | go-http |
net/http | Beta |
| Rust | rust-reqwest |
reqwest | Beta |
| Rust | rust-ureq |
ureq | Beta |
| Rust | rust-aioduct |
aioduct | Beta |
| Python | python-httpx |
httpx | Beta |
| Python | python-requests |
requests | Beta |
| Java | java-okhttp |
OkHttp | Beta |
| Kotlin | kotlin-okhttp |
OkHttp | Beta |
Quick Start
Install
Download a binary from the releases page, or build from source:
Requires Rust 1.90+.
Generate
# TypeScript client
# Go client
# Rust client (reqwest)
# Python client (httpx)
# Java client
# Multiple generators at once
Configuration
Configuration resolves in order: CLI args > environment variables (OPENAPI_NEXUS_*) > config file (openapi-nexus-config.toml) > defaults.
# Environment variables
Generator-specific options go in the config file:
[]
= "github.com/myorg/myproject/sdk"
[]
= true
= "workspace_version"
[]
= ["PartialEq"]
[]
= ["Hash"]
[]
= true
= '{ version = "5" }'
[]
= true
= true
How It Works
OpenAPI YAML/JSON → parse → lower to IR → CodeGenerator::generate(&IrSpec) → write
Parsing auto-detects OAS version (3.0, 3.1, 3.2). Lowering produces a version-agnostic IrSpec. Each generator receives the pre-lowered IR and uses sigil-stitch for type-safe code emission.
Documentation
Full documentation is available at the project docs site.
Development
# Run all tests
# Clippy (required before commit)
# Update golden files after intentional output changes
UPDATE_GOLDEN=1
# Compile-check generated output for all languages
License
Dual-licensed under MIT or Apache-2.0 at your option.