swagger-api/swagger-ui

Swagger UI doesn't know how to deal when URLS is empty array

Open

#5.663 geöffnet am 16. Okt. 2019

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (8.801 Forks)batch import
HacktoberfestP2cat: user experiencetype: bug

Repository-Metriken

Stars
 (25.447 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 20h 34m) (14 gemergte PRs in 30 T)

Beschreibung

Q&A (please complete the following information)

  • OS: linux (Ubuntu 18.04)
  • Browser: google Chrome
  • Version: 78.0.3904.50
  • Method of installation: webjars Clasic
  • Swagger-UI version: 3.23.8
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Swagger-UI configuration options:

SwaggerUI({
 urls: [ ]
})

Describe the bug you're encountering

Swagger UI doesn't know hot to render when URLS parameter is an empty array ("[]"). It reports an error

To reproduce...

Steps to reproduce the behavior:

  1. open swaggerUI
  2. extend address with "?urls=[]" OR change inital swaggerUI configuration inside index.html to something like:
SwaggerUI({
 urls: [ ]
})

Expected behavior

I expect that topbar will be with empty selector.

Contributor Guide