Openapi
A set of packages and tools for working with OpenAPI, Swagger, Arazzo and Overlay Specification documents.
Install / Use
/learn @speakeasy-api/OpenapiREADME
Main Packages
arazzo
The arazzo package provides an API for working with Arazzo documents including reading, creating, mutating, walking and validating them.
openapi
The openapi package provides an API for working with OpenAPI documents including reading, creating, mutating, walking, validating, upgrading, and linting them. Supports OpenAPI 3.0.x, 3.1.x, and 3.2.x specifications.
The openapi/linter subpackage provides a configurable linter with 60+ built-in rules covering style, security (OWASP), and semantic validation. Custom rules can be written in TypeScript/JavaScript using the @speakeasy-api/openapi-linter-types package.
swagger
The swagger package provides an API for working with Swagger 2.0 documents including reading, creating, mutating, walking, validating, and upgrading them to OpenAPI 3.0.
overlay
The overlay package provides an API for working with OpenAPI Overlays including applying overlays to specifications, comparing specifications to generate overlays, and validating overlay documents.
CLI Tool
This repository also provides a comprehensive CLI tool for working with OpenAPI specifications, Arazzo workflows, and OpenAPI overlays.
Installation
Homebrew (macOS/Linux):
brew install openapi
Go Install:
go install github.com/speakeasy-api/openapi/cmd/openapi@latest
Script Installation:
Linux/macOS:
curl -fsSL https://go.speakeasy.com/openapi.sh | bash
Windows (PowerShell):
iwr -useb https://go.speakeasy.com/openapi.ps1 | iex
For manual installation, upgrade instructions, custom installation options, and troubleshooting, see the detailed installation guide.
Usage
The CLI provides four main command groups:
-
openapi spec- Commands for working with OpenAPI specifications (documentation)bootstrap- Create a new OpenAPI document with best practice examplesbundle- Bundle external references into components sectionclean- Remove unused components and unused top-level tags from an OpenAPI specificationexplore- Interactively explore an OpenAPI specification in the terminalinline- Inline all references in an OpenAPI specificationjoin- Join multiple OpenAPI documents into a single documentlint- Lint an OpenAPI specification for style, security, and best practiceslocalize- Localize an OpenAPI specification by copying external references to a target directoryoptimize- Optimize an OpenAPI specification by deduplicating inline schemassanitize- Remove unwanted elements from an OpenAPI specificationsnip- Remove or filter operations in an OpenAPI specification (interactive or CLI)upgrade- Upgrade an OpenAPI specification to the latest supported versionvalidate- Validate an OpenAPI specification documentquery- Query an OpenAPI specification using the oq pipeline language to answer structural and semantic questions about schemas and operationsquery-reference- Print the complete oq query language reference
-
openapi swagger- Commands for working with Swagger 2.0 documents (documentation)validate- Validate a Swagger 2.0 specification documentupgrade- Upgrade a Swagger 2.0 specification to OpenAPI 3.0
-
openapi arazzo- Commands for working with Arazzo workflow documents (documentation)validate- Validate an Arazzo workflow document
-
openapi overlay- Commands for working with OpenAPI overlays (documentation)apply- Apply an overlay to an OpenAPI specificationcompare- Compare two specifications and generate an overlay describing differencesvalidate- Validate an OpenAPI overlay document
Quick Examples
# Validate an OpenAPI specification
openapi spec validate ./spec.yaml
# Lint for style, security, and best practices
openapi spec lint ./spec.yaml
# Lint with custom configuration
openapi spec lint --config lint.yaml ./spec.yaml
# Bundle external references into components section
openapi spec bundle ./spec.yaml ./bundled-spec.yaml
# Inline all references to create a self-contained document
openapi spec inline ./spec.yaml ./inlined-spec.yaml
# Upgrade OpenAPI spec to latest version
openapi spec upgrade ./spec.yaml ./upgraded-spec.yaml
# Apply an overlay to a specification
openapi overlay apply --overlay overlay.yaml --schema spec.yaml
# Validate an Arazzo workflow document
openapi arazzo validate ./workflow.arazzo.yaml
# Validate a Swagger 2.0 document
openapi swagger validate ./api.swagger.yaml
# Upgrade Swagger 2.0 to OpenAPI 3.0
openapi swagger upgrade ./api.swagger.yaml ./openapi.yaml
# Query schema graph — find deeply nested components
openapi spec query 'schemas | where(isComponent) | sort-by(depth, desc) | take(10) | select name, depth' ./spec.yaml
# Query schema graph — blast radius of
Related Skills
xurl
346.4kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
wanwu
4.2kChina Unicom's Yuanjing Wanwu Agent Platform is an enterprise-grade, multi-tenant AI agent development platform. It helps users build applications such as intelligent agents, workflows, and rag, and also supports model management. The platform features a developer-friendly license, and we welcome all developers to build upon the platform.
gin-vue-admin
24.5k🚀Vite+Vue3+Gin拥有AI辅助的基础开发平台,企业级业务AI+开发解决方案,内置mcp辅助服务,内置skills管理,支持TS和JS混用。它集成了JWT鉴权、权限管理、动态路由、显隐可控组件、分页封装、多点登录拦截、资源权限、上传下载、代码生成器、表单生成器和可配置的导入导出等开发必备功能。
kubeshark
11.9keBPF-powered network observability for Kubernetes. Indexes L4/L7 traffic with full K8s context, decrypts TLS without keys. Queryable by AI agents via MCP and humans via dashboard.
