-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Allow local ref's to be served by nginx #5565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Is there a timeframe for merging this change into master and deployed? I would like to leverage this from the main DockerHub image to allow me to break my Swagger spec up into multiple files. |
7b7c648 to
e6f0aae
Compare
|
Guys, any news on this? I tried this myself and it works like a charm. It allows me to break my huge API specs to separated files. This is such a no-brainer that I wonder why this is not yet in master. |
b3d3f09 to
63404df
Compare
4fc895c to
26f9ffb
Compare
Signed-off-by: Wesley Schwengle <[email protected]>
This changeset uses the directory name of the SWAGGER_JSON file to use
as a root for all the files that have the following {json,yml,yaml}
extension.
By doing this one can use a docker-compose.yml like so:
```
environment:
- "SWAGGER_JSON=/openapi/zd.yaml"
volumes:
- "./openapi:/openapi"
```
or run docker like described in the installation.md file:
```
docker run -p 80:8080 \
-e SWAGGER_JSON=/foo/swagger.json -v /bar:/foo swaggerapi/swagger-ui
```
Everything from /bar is mounted in /foo and /foo is than used by nginx
to serve it's openapi specification files.
Fixes: swagger-api#5318, swagger-api#5496, swagger-api#4915
Signed-off-by: Wesley Schwengle <[email protected]>
|
Leave me a comment when you want to merge this so I can rebase it again. Rebasing every week is getting old. |
|
@waterkip Merged, thanks for contribution! |
|
It looks like this change is causing a bug. When defining BASE_URL environment variable, the docker image is not able to find the json/yaml file. |
|
@vanhove Oops :) I'll have a look later today to see if I can reproduce and fix it. |
This changeset uses the directory name of the SWAGGER_JSON file to use
as a root for all the files that have the following {json,yml,yaml}
extension.
By doing this one can use a docker-compose.yml like so:
or run docker like described in the installation.md file:
Everything from /bar is mounted in /foo and /foo is than used by nginx
to serve it's openapi specification files.
Fixes: #5318, #5496, #4915
How Has This Been Tested?
I manually tested my changes by running docker-compose with the configuration described above and manually by running
docker run -p 8081:8080 -e "SWAGGER_JSON=/app/zd.yaml" -v $(pwd)/openapi:/app swaggerapi/swagger-uiChecklist
My PR contains...
src/is unmodified: changes to documentation, CI, metadata, etc.)package.json)My changes...
Documentation
Automated tests