Using docker
The definition validate commands can be executed using the qaskx-cli docker image from the Docker Hub repository.
To use the docker container, you will need to:
- Pull the docker image (docker pull qaskx/qaskx-cli:latest), or perform this automatically
- Execute the docker run command
Some more details and examples follow.
The simple command to validate an Internet located OpenAPI specification is:
docker run --rm -it qaskx/qaskx-cli:latest definition validate --spec ^^URL^^where the ^^URL^^ is replaced with the HTTP/S location of the OpenAPI file.
If the OpenAPI file is only available on your local machine then the command is a little more complex. The assumption is that the named file is located in your current directory.
docker run --volume .:/qaskx --rm -it qaskx/qaskx-cli:latest definition validate --spec /qaskx/^^file^^ If you want to save the output then the docker command form becomes
docker run --volume .:/qaskx --rm -it qaskx/qaskx-cli:latest definition validate --spec ^^URL^^ --output /qaskx/validate_openAPI.csv Example
Using the PetStore OpenAPI, the command would be:
docker run --rm -it qaskx/qaskx-cli:latest definition validate --spec https://petstore3.swagger.io/api/v3/openapi.jsonOr without the logo
docker run --rm -it qaskx/qaskx-cli:latest definition validate --spec https://petstore3.swagger.io/api/v3/openapi.json --silentIf you want to save the output then the docker command becomes
docker run --volume .:/qaskx --rm -it qaskx/qaskx-cli:latest definition validate --spec https://petstore3.swagger.io/api/v3/openapi.json --silent --output /qaskx/validate_openAPI.csv