swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.48k stars 8.95k forks source link

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

Open jskelin opened 5 years ago

jskelin commented 5 years ago

Q&A (please complete the following information)

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.

leonardovillela commented 4 years ago

Can i take this issue?

leonardovillela commented 4 years ago

I guess this issue will be resolved, when this issue is resolved too: https://github.com/swagger-api/swagger-ui/issues/3302

abhicodes01 commented 6 days ago

/assign