swagger-api/swagger-ui

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

Open

#5,663 建立於 2019年10月16日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)JavaScript (8,801 fork)batch import
HacktoberfestP2cat: user experiencetype: bug

倉庫指標

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

描述

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.

貢獻者指南