Browse Source

Merge pull request #36 from kbedel/master

Allow override of validatorUrl parameter to specify custom Swagger validator
pull/37/head
Johannes Schickling 8 years ago
committed by GitHub
parent
commit
c09b23fcbf
  1. 1
      swagger-ui/README.md
  2. 5
      swagger-ui/run.sh

1
swagger-ui/README.md

@ -13,3 +13,4 @@ $ docker run -d -p 80:80 -e API_URL=http://localhost:4000/swagger schickling/swa
* `API_URL` - Swagger endpoint for your API
* `API_KEY` - Default API Key (optional)
* `PORT` - Default port to run on (optional)
* `VALIDATOR_URL` - Swagger validator (optional)

5
swagger-ui/run.sh

@ -16,4 +16,9 @@ else
sed -i "s|http://example.com/api|$API_URL|g" index.html
fi
if [[ -n "$VALIDATOR_URL" ]]; then
sed -i "s|.*validatorUrl:.*$||g" index.html
sed -i "s|\(url: url,.*\)|\1\n validatorUrl: \"${VALIDATOR_URL}\",|g" index.html
fi
exec http-server -p $PORT $*
Loading…
Cancel
Save