Trusted by the OpenAPI community
More OpenAPI tools from the community can be found on openapi.tools .
Alphabetically sort fields, paths, and components for consistent ordering.
Read docsRemove internal endpoints, tags, or unused components before publishing.
Read docsStandardise casing, indentation, and structure across your specs.
Read docsApply overlays to add or override parts of your OpenAPI document.
Read docsSplit large specs into files or bundle multiple files into one.
Read docsConvert between JSON and YAML, or between OpenAPI versions.
Read docsStrip internal endpoints and sort your spec before publishing external documentation.
Keep large OpenAPI files readable and diff-friendly for easier code reviews.
Automate formatting and filtering in your pipeline to enforce spec standards.
Before
openapi: 3.0.3
info:
title: Pet Store API
version: 1.0.0
paths:
/pets/{petId}:
get:
summary: Get pet by ID
/pets:
post:
summary: Create a pet
get:
summary: List all pets
components:
schemas:
Pet:
type: object
Error:
type: objectAfter
openapi: 3.0.3
info:
title: Pet Store API
version: 1.0.0
paths:
/pets:
get:
summary: List all pets
post:
summary: Create a pet
/pets/{petId}:
get:
summary: Get pet by ID
components:
schemas:
Error:
type: object
Pet:
type: objectFormat a spec
npx openapi-format openapi.yaml -o formatted.yamlSort & filter
npx openapi-format openapi.yaml --sortFile sort.json --filterFile filter.jsonConvert to JSON
npx openapi-format openapi.yaml -o openapi.jsonInstall
npm install --save openapi-format