Skip to content

entur/openapi-validator-cli

Repository files navigation

OpenAPI Validator CLI

GitHub Release Rust Homebrew License Issues Pull Requests Last Commit

Local CLI for linting, generating, and compiling OpenAPI specs. Runs everything through Docker, keeps output under .oav/, and uses a simple .oavc config file per project.

Quick start

oav init --spec openapi/api.yaml
oav validate

Install

Homebrew

brew tap entur/openapi-validator-cli https://github.com/entur/openapi-validator-cli
brew install oav

Shell script

curl -fsSL https://raw.githubusercontent.com/entur/openapi-validator-cli/main/install.sh | bash

Cargo

cargo install --git https://github.com/entur/openapi-validator-cli

Uninstall

Method Command
Homebrew brew uninstall oav
Cargo cargo uninstall oav
Manual rm /usr/local/bin/oav

Commands

Command Description
oav init Scaffold .oav/ and .oavc (omit --spec for interactive wizard)
oav validate Run lint, generate, compile pipeline and write reports
oav config [get|set|edit|print] Manage .oavc
oav config validate Check config for errors
oav config list-generators List supported generators
oav config ignore / unignore Toggle .oavc in .gitignore
oav clean Remove .oav/
oav clean --nuke Remove .oav/, .oavc, and gitignore entries
oav agent install / uninstall Manage the Claude Code skill
oav completions install / uninstall Manage shell completions

Output modes

Flag Behavior
(default) Step summaries + per-generator progress
-v, --verbose Stream full tool output
-q, --quiet Minimal output
--output json Machine-readable JSON (for CI/scripts)

Parallelism

oav validate -j4           # 4 parallel jobs
oav validate --jobs auto   # auto-detect (default, capped at 4)

Also configurable via the jobs key in .oavc.

Generators

Type Generators
Server aspnetcore, go-server, kotlin-spring, python-fastapi, spring, typescript-nestjs
Client csharp, go, java, kotlin, python, typescript-axios, typescript-fetch, typescript-node

Generator configs are available in .oav/generators/ after init.

Config

.oavc lives in the repo root. Minimal example:

spec: openapi/api.yaml
mode: both
linter: spectral

See CONFIGURATION.md for the full reference and examples/ for ready-to-use configs.

GitHub Action

Available as a reusable action for CI workflows. See the GitHub Action docs for setup, inputs, and outputs.

- uses: entur/openapi-validator-cli/action/setup@v0
- uses: entur/openapi-validator-cli/action/validate@v0
  with:
    spec: openapi/api.yaml

Output layout

.oav/
  generated/          # generated code
  reports/            # logs and status
  reports/dashboard.html  # HTML report summary

Requirements

  • Docker (for linting, generation, and compile steps)

Build

cargo build --release

Testing

Integration tests live under tests/ and require Docker.

cargo test -- --ignored

About

Local CLI for linting, generating, and compiling OpenAPI specs

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors