Skip to content

Instantly share code, notes, and snippets.

@komiyak
Last active May 13, 2019 09:07
Show Gist options
  • Save komiyak/6d80611b045894199c5f96d2ffb5a72b to your computer and use it in GitHub Desktop.
Save komiyak/6d80611b045894199c5f96d2ffb5a72b to your computer and use it in GitHub Desktop.
Build a html from your OpenAPI Specification (OAS 3.0).
#!/bin/bash
CODEGEN_V='3.0.8'
if [ ! -d ./build/swagger-codegen-$CODEGEN_V/ ]; then
rm -rf build/
mkdir -p build/
wget -qO- https://github.com/swagger-api/swagger-codegen/archive/v$CODEGEN_V.tar.gz | tar zxvf - -C ./build
# Build the jar file.
pushd build/swagger-codegen-$CODEGEN_V/
mvn clean package
popd
fi
# Build a html from OpenAPI Spec.
java -jar build/swagger-codegen-$CODEGEN_V/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i openapi.yaml -l html2 -o out/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment