swagger-api / swagger-api/swagger-ui

Setting VALIDATOR_URL=null with Docker results in broken link

Open
#5,519 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: docker Hacktoberfest type: bug
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q&A (please complete the following information)
  • OS: Docker on Windows 10 with Linux containers
  • Browser: Chrome
  • Version: 76
  • Method of installation: Docker
  • Swagger-UI version: v3.23.4
  • Swagger/OpenAPI version: Swagger 2.0
Describe the bug you're encountering

When running the Docker container with -e VALIDATOR_URL=null, the validator badge is not disabled and instead shows up as a broken link. The documentation at https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md#network says to use null to disable the validator badge. It appears that an empty string does disable the validator (i.e. -e VALIDATOR_URL=). I'm not sure which behavior was intended, but if an empty string was the intended way to disable the validator, the documentation should probably be more explicit.

To reproduce...

Steps to reproduce the behavior:

  1. Run Docker container with docker run -d -p 80:8080 -e URL=http://mySwaggerSpec -e VALIDATOR_URL=null swaggerapi/swagger-ui
  2. Browse to the local Swagger UI using something other than localhost (e.g. http://myComputerDnsName)
  3. The validator badge displays as a broken image with a broken link
Expected behavior

The validator badge should not show up at all.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with the documented Docker command using VALIDATOR_URL=null, then compare it with the empty-string case. Start with docs/usage/configuration.md#network and the Docker configuration path; done means the null setting hides the validator badge and the documentation clearly describes the supported disabling value.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, javascript
Domain
devops, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.