Open luckydonald opened 3 years ago
For a workaround (and proof of the bug fix):
In the folder where your docker-compose.yml
is, create a Dockerfile
like so:
FROM swaggerapi/swagger-editor:v3.16.3
# Fix this line:
# https://github.com/swagger-api/swagger-editor/blob/be2b04b8d1719fdb5aa47dbc03e2fe91a11525b4/docker-run.sh#L17
# BEFORE: REL_PATH="/$(basename $SWAGGER_FILE)"
# AFTER : REL_PATH="${BASE_URL}/$(basename $SWAGGER_FILE)"
RUN RUN_CMD_FILE=/usr/share/nginx/docker-run.sh \
&& sed -i 's|REL_PATH="/$(basename $SWAGGER_FILE)"|REL_PATH="${BASE_URL}/$(basename ${SWAGGER_FILE})"|g' ${RUN_CMD_FILE} \
&& cat $RUN_CMD_FILE
For that, in the yaml file change
- image: swaggerapi/swagger-editor
to
build:
context: .
dockerfile: Dockerfile
Should I prepare a PR?
@luckydonald Yes, please create a PR for your proposed solution. Thanks!
@tim-lai I encountered the same problem (still unsolved).
Q&A (please complete the following information)
Should be irrevelant
- OS: macos - Browser: chrome - Version: latest - Method of installation: docker - Swagger-Editor version: latest - Swagger/OpenAPI version: OpenAPI ~~3.1~~ 3.0.3Content & configuration
docker-compose.yaml
nginx reserve proxy:
Describe the bug you're encountering
To reproduce...
Steps to reproduce the behavior:
api/docs
in nginx for that imageBASE_URL
accordingly, toapi/docs/
domain/$BASE_URL
, herehttps://example.com/api/docs/
.https://example.com/api.yml
(incorrect)https://example.com/api/docs/api.yml
would be correctExpected behavior
The frontend can be put to a different route with
BASE_URL
, however that is ignored for theyaml
file.Screenshots
Additional context or thoughts
This should be easily fixed by changing The route is however not considered for the
yaml
file.That is, https://github.com/swagger-api/swagger-editor/blob/be2b04b8d1719fdb5aa47dbc03e2fe91a11525b4/docker-run.sh#L17 not always point to the root but to the
$BASE_URL
.