swagger-api / swagger-api/swagger-ui

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

Open
#5,663 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: user experience Hacktoberfest P2 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: 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

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 issue with SwaggerUI({ urls: [] }) or the ?urls=[] query parameter in Swagger UI 3.23.8, then trace how the topbar handles the URLS configuration. The work is done when an empty URL list renders an empty selector without reporting an error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.