npx @redocly/cli lint openapi.yaml

Category: Web App Development

npx @redocly/cli lint openapi.yaml

Lint an OpenAPI spec for errors and style

Validates openapi.yaml against the OpenAPI ruleset, reporting broken references, missing fields and naming problems. The lint command exits non-zero on errors, so it slots into CI. Auto-fix simple issues with the --format option and redocly lint --extends recommended.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.