Using docker

The definition extract commands can be executed using the qaskx-cli docker image from the Docker Hub repository.

To use the docker container, you will need to:

  1. Pull the docker image (docker pull qaskx/qaskx-cli:latest), or perform this automatically
  2. Execute the docker run command

Some more details and examples follow.

docker run --rm -it qaskx/qaskx-cli:latest definition extract --category basic --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 extract --category basic --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 extract --category basic --spec ^^URL^^ --output /qaskx/extract_openAPI.csv  

Example

Using the PetStore OpenAPI, the command would be:

docker run --rm -it qaskx/qaskx-cli:latest definition extract --category basic --spec https://petstore3.swagger.io/api/v3/openapi.json

Or without the logo

docker run --rm -it qaskx/qaskx-cli:latest definition extract --category basic --spec https://petstore3.swagger.io/api/v3/openapi.json --silent

If you want to save the output then the docker command becomes

docker run --volume .:/qaskx  --rm -it qaskx/qaskx-cli:latest definition extract --category basic --spec https://petstore3.swagger.io/api/v3/openapi.json --silent --output /qaskx/extract_openAPI.csv