CLI (Command Line Interface)ΒΆ

Straight forward way:

openapi-spec-validator openapi.yaml

pipes way:

cat openapi.yaml | openapi-spec-validator -
docker run -v path/to/openapi.yaml:/openapi.yaml --rm pythonopenapi/openapi-spec-validator /openapi.yaml
python -m openapi_spec_validator openapi.yaml
usage: openapi-spec-validator [-h] [--errors {best-match,all}]
                              [--schema {2.0,3.0.0,3.1.0,detect}]
                              filename

positional arguments:
  filename              Absolute or relative path to file

options:
  -h, --help            show this help message and exit
  --errors {best-match,all}
                        Control error reporting. Defaults to "best-
                        match", use "all" to get all subschema
                        errors.
  --schema {2.0,3.0.0,3.1.0,detect}
                        OpenAPI schema (default: detect)