// readme

openapi2zig

A CLI tool and Zig library that generates type-safe models and API client code in Zig from OpenAPI specifications.

Features

  • Parse and generate from Swagger v2.0, OpenAPI v3.0, v3.1, and v3.2 specifications
  • Generate type-safe Zig client code
  • Support for complex OpenAPI schemas and operations
  • Cross-platform support (Linux, macOS, Windows)
  • Available as both CLI tool and Zig library
  • Unified document representation for all OpenAPI and Swagger versions

Installation

Linux/macOS:

curl -fsSL https://christianhelle.com/openapi2zig/install | bash

Windows (PowerShell):

irm https://christianhelle.com/openapi2zig/install.ps1 | iex

The install scripts will:

  • Automatically detect your platform and architecture
  • Download the latest release from GitHub
  • Install the binary to an appropriate location
  • Add it to your PATH (if desired)

Custom installation directory:

# Linux/macOS
curl -fsSL https://christianhelle.com/openapi2zig/install | INSTALL_DIR=$HOME/.local/bin bash

# Windows
& ([scriptblock]::Create((irmโ€ฆ