This is a small community Docker image providing IBM's OpenAPI Validator.
-
To validate a specification file
openapi.yamlin the current directory, mount the current directory at/datain the container (this is the image's default working directory):$ docker run \ --volume "$PWD":/data \ jamescooke/openapi-validator openapi.yaml -
The
initcommand can be used to generate the initial.validatercfile, which will be created in the mounted directory.$ docker run \ --volume "$PWD":/data \ jamescooke/openapi-validator initYou may need to adjust the permissions of the generated file.
-
If you prefer to rename your config file, for example to
config.json, then this can be passed with the--configflag:$ docker run \ --volume "$PWD":/data \ jamescooke/openapi-validator openapi.yaml --config config.json
-
This is a "small-ish" container built on the official Node 13 Alpine base image.
-
OpenAPI validator is installed in the container using
npm. -
Image tags are kept synchronised with the version of OpenAPI validator. For example, image
0.21.0contains OpenAPI validator version0.21.0:$ docker run jamescooke/openapi-validator:0.21.0 --version 0.21.0
-
OpenAPI Validator: repository, releases
-
Docker container: docker hub