Container for building swagger code
612
Container for building swagger code
Before you can generate code, you first need to aquire the docker image.
To build the image from source, run the following command:
sh script/build
To pull the latest version of the image from DockerHub, run the following command:
docker pull sandcastle/swagger-codegen-docker
To generate swagger output - run the following docker command:
docker run \
-v "${PWD}/spec:/spec" \
-v "${PWD}/tmp/output/html:/gen" \
-e "LANGUAGE=dynamic-html" \
-e "SWAGGER_FILE=swagger.yml" \
sandcastle/swagger-codegen-docker
Below explains what each line does:
-v "${PWD}/spec:/spec" \ - maps the local spec folder (${PWD}/spec) to the internal spec folder (/spec)-v "${PWD}/tmp/output/html:/gen" \ - maps the local output folder (${PWD}/tmp/output/html) to the internal output folder (/gen)-e "LANGUAGE=dynamic-html" \ - the language to generate the output in (see below)-e "SWAGGER_FILE=swagger.yml" \ - the name of the swagger file (within the /spec volume above)sandcastle/swagger-codegen-docker - the name of the docker image to runThe following languages are available for generation:
Content type
Image
Digest
sha256:537c75df6…
Size
421.9 MB
Last updated
about 11 years ago
docker pull sandcastle/swagger-codegen-docker