swagger-api / swagger-api/swagger-ui

Loading spinner should show when using the Spec parameter

Open
#4,512 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: user experience type: enhancement
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q A
Bug or feature request? Feature
Which Swagger-UI version? 03.14.0
How did you install Swagger-UI? NPM
Which browser & version? Firefox 61
Which operating system? Win 10
Configuration (browser query string, constructor, config.yaml)
const ui = SwaggerUI({
      spec: JSON.parse(json),
      validatorUrl: '',
      domNode: this.el.nativeElement.querySelector('.swagger-container'),
      docExpansion: 'none',
      presets: [
        SwaggerUI.presets.apis,
      ]
    });
Expected Behavior

If you supply a large JSON spec to the spec parameter, which causes Swagger-UI to take a few seconds to render, it would be nice to show the same loading spinner that is displayed when loading a spec from a URL.

Current Behavior

Currently nothing is shown.

Possible Solution

Use the same spinner that is shown when waiting for the spec to download if you are using the URL parameter.

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

Start at the SwaggerUI constructor configuration using the spec parameter, then compare it with the existing URL-based spec loading path that displays a spinner. Confirm the behavior with a large JSON spec and consider how the loading state is tested; done means the same spinner appears while the inline spec is rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
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.