apidom-validate-cli
v0.2.0
Published
CLI tool that validates OpenAPI / AsyncAPI files with the same diagnostics as editor.swagger.io (via @swagger-api/apidom-ls)
Maintainers
Readme
apidom-validate-cli
A CLI that validates OpenAPI / AsyncAPI files and prints the same diagnostics you see in editor.swagger.io, powered by the ApiDOM Language Service.
Use it locally or in CI to catch issues before push, with error messages and codes matching the official Swagger Editor.
Usage
npx apidom-validate-cli <file>Example
npx apidom-validate-cli ./openapi.yamlOutput:
/openapi.yaml
11:21 error should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null 10001
161:11 warning property "example" is deprecated, use "examples" instead 10069
✖ 2 problems (1 error, 1 warning)Exit code is 0 when no errors are found, 1 otherwise.
Credits
Heavily inspired by the swaggerexpert/apidom-validate GitHub Action — this package fills the gap of running the same validation locally or in non-Action CI.
