From bbe438f4734561bb81d88f98b3005d9ee7d18b2d Mon Sep 17 00:00:00 2001 From: kevi6083 Date: Sun, 28 Aug 2016 20:33:08 -0600 Subject: [PATCH] Add ability to override Swagger valdiatorUrl property --- swagger-ui/README.md | 1 + swagger-ui/run.sh | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/swagger-ui/README.md b/swagger-ui/README.md index bcba426..a1b6a75 100644 --- a/swagger-ui/README.md +++ b/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) diff --git a/swagger-ui/run.sh b/swagger-ui/run.sh index 22bca36..7e00aa6 100644 --- a/swagger-ui/run.sh +++ b/swagger-ui/run.sh @@ -16,4 +16,8 @@ else sed -i "s|http://example.com/api|$API_URL|g" index.html fi +if [[ -n "$VALIDATOR_URL" ]]; then + sed -i "s|url: url,.*|url: url, validatorUrl: \"${VALIDATOR_URL}\",|g" index.html +fi + exec http-server -p $PORT $*