Created
November 30, 2023 20:35
-
-
Save alirezaarzehgar/fea310f7ee0134315b077200f823d8d8 to your computer and use it in GitHub Desktop.
Use swagger static
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SWAGGER_JSON_PATH=/tmp/docs/swagger.json | |
SWAGGER_VERSION=5.10.3 | |
SWAGGER_RELEASE=https://github.com/swagger-api/swagger-ui/archive/refs/tags/v${SWAGGER_VERSION}.zip | |
DIRNAME=swagger-ui-${SWAGGER_VERSION} | |
wget --no-clobber ${SWAGGER_RELEASE} -O swag.zip | |
unzip swag.zip | |
mkdir public | |
mv ${DIRNAME}/dist/* public | |
rm -rf ${DIRNAME} | |
cp ${SWAGGER_JSON_PATH} public | |
sed -i 's/https:\/\/petstore.swagger.io\/v2\/swagger.json/.\/swagger.json/' public/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment