9 releases
Uses new Rust 2024
| 0.0.3 | Jan 4, 2026 |
|---|---|
| 0.0.3-alpha.1 | Jan 9, 2026 |
| 0.0.2 | Dec 2, 2025 |
| 0.0.1 |
|
#12 in #3-1
Used in 3 crates
105KB
1.5K
SLoC
π OpenAPI Nexus (Working In Progress)
OpenAPI 3.1 to Code Generator - Generate type-safe, production-ready code from OpenAPI specifications
OpenAPI Nexus is a modern, modular code generator that transforms OpenAPI 3.1 specifications into client or server libraries. It provides a flexible, extensible architecture for generating high-quality code across multiple languages.
β¨ Features
- π― OpenAPI 3.1 Support - Support for OpenAPI 3.1 specifications
- ποΈ Modular Architecture - Extensible pipeline design allows easy addition of new languages and transformations
- π¦ Multi-file Output - Organized output structure with separate API, model, and runtime modules
- π¨ Configurable - Flexible configuration via CLI, environment variables, or config files
- π Transform Pipeline - Built-in transformation passes for normalization and optimization (Working In Progress)
- π Template-based - Jinja2-style templates for customizable code generation
π¦ Quick Start
Installation
- Download the binary from the releases page.
Basic Usage
Generate TypeScript code from an OpenAPI specification:
openapi-nexus generate --input path/to/openapi.yaml --output generated --generator typescript-fetch
π Configuration
OpenAPI Nexus supports multiple configuration methods with the following precedence (highest to lowest):
- Command-line arguments
- Environment variables
- Configuration file (
openapi-nexus-config.toml) - Defaults
Configuration File (Optional)
Create an openapi-nexus-config.toml file in your project root by referencing the sample configuration file.
Environment Variables
All configuration options can also be set via environment variables:
export OPENAPI_NEXUS_INPUT="spec.yaml"
export OPENAPI_NEXUS_OUTPUT="generated"
export OPENAPI_NEXUS_GENERATOR="typescript-fetch"
export OPENAPI_NEXUS_TS_FILE_NAMING_CONVENTION="PascalCase"
CLI Options
openapi-nexus generate --help
ποΈ Language Support
- β TypeScript
- π§ Rust
- π§ Python
- π§ Go
- ...
ποΈ Architecture
OpenAPI Nexus follows a modular, pipeline-based architecture:
OpenAPI Spec β Parse β Transform β AST β Emit β Generated Code
Pipeline Stages
- Parse - Converts OpenAPI YAML/JSON to internal representation using utoipa
- Transform - Applies extra modifications to the OpenAPI specification
- AST Generation - Converts to language-specific partial Abstract Syntax Trees
- Emission β Produces formatted source code from ASTs using a hybrid templating approach
π License
This project is dual-licensed under either:
- MIT License (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)
at your option.
Dependencies
~17β25MB
~353K SLoC