swagger-api/swagger-ui

Setting VALIDATOR_URL=null with Docker results in broken link

開放

#5,519 建立於 2019年8月5日

 (2 則留言) (0 個反應) (0 位負責人)JavaScript (8,801 個分叉)batch import
Hacktoberfestcat: dockertype: bug

倉庫指標

星標
 (25,447 顆星)
PR 合併指標
 (平均合併 20小時 34分鐘) (30 天內合併 14 個 PR)

描述

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.

貢獻者指南