⚒️ OpenAPI CLI toolbox with rich validation and bundling features.
OpenAPI CLI toolbox with rich validation and bundling features.
Currently, @redocly/openapi-cli supports these features:
Unlike other OpenAPI linters,
@redocly/openapi-clidefines the possible type tree of a valid OpenAPI definition and then traverses it. This approach is very similar to how linters for programming languages work and results in major performance benefits over other approaches. Extend functionality at different points in the lifecycle with preprocessors, rules, and decorators.
npx @redocly/openapi-cli lint path-to-root-file.yaml
To give the docker container access to the OpenAPI definition files, you need to mount the containing directory as a volume. Assuming the OAS definition is rooted in the current working directory, you need the following command:
docker run --rm -v $PWD:/spec redocly/openapi-cli lint path-to-root-file.yaml
To build and run with a local image, run the following from the project root:
docker build -t openapi-cli . docker run --rm -v $PWD:/spec openapi-cli lint path-to-root-file.yaml