OpenAPI 3.1 to multi-language code generator
OpenAPI Nexus transforms OpenAPI 3.1 specifications into type-safe client libraries. Generated output is deterministic, compile-checked in CI, and tested byte-for-byte via golden tests.
| Language | Generator | Status |
|---|---|---|
| TypeScript (fetch) | typescript-fetch |
Stable |
| Go (net/http) | go-http |
Stable |
Download a binary from the releases page, or build from source:
cargo install --path crates/openapi-nexusRequires Rust 1.90+.
# TypeScript client
openapi-nexus generate -i spec.yaml -o output -g typescript-fetch
# Go client
openapi-nexus generate -i spec.yaml -o output -g go-http
# Both at once
openapi-nexus generate -i spec.yaml -o output -g typescript-fetch,go-httpConfiguration resolves in order: CLI args > environment variables (OPENAPI_NEXUS_*) > config file (openapi-nexus-config.toml) > defaults.
# Environment variables
export OPENAPI_NEXUS_INPUT="spec.yaml"
export OPENAPI_NEXUS_OUTPUT="generated"
export OPENAPI_NEXUS_GENERATOR="typescript-fetch"Generator-specific options go in the config file:
[generators.go-http]
module_path = "github.com/myorg/myproject/sdk"OpenAPI YAML/JSON → parse → lower to IR → CodeGenerator::generate(&IrSpec) → write
Parsing auto-detects OAS version. Lowering produces a version-agnostic IrSpec. Each generator receives the pre-lowered IR and uses sigil-stitch for type-safe code emission.
Full documentation is available at the project docs site.
# Run all tests
cargo test
# Clippy (required before commit)
cargo clippy --all-targets --all-features -- -D warnings
# Update golden files after intentional output changes
UPDATE_GOLDEN=1 cargo test
# Compile-check generated output
just golden::build-allDual-licensed under MIT or Apache-2.0 at your option.