swagger-api / swagger-api/swagger-ui

Opening a Model of the Swagger Petstore shows a warning in the console

Open
#4,597 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

cat: user experience 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: macOs
  • Browser: safari
  • Version: 11.1
  • Method of installation: npm
  • Swagger-UI version: 3.16.0
  • Swagger/OpenAPI version: Swagger 2.0
Content & configuration

Example Swagger/OpenAPI definition:
Petstore Demo: http://petstore.swagger.io/v2/swagger.json

Swagger-UI configuration options:
Default configuration - npm run dev

Describe the bug you're encountering

The browser console shows the following warning when opening a Model:

VM5274 10:33 Warning: Failed prop type: Invalid prop `schema` of type `Immutable.Map` supplied to `Model`, expected `OrderedMap`.
    in Model (created by ModelWrapper)
    in ModelWrapper (created by Models)
    in span (created by ModelCollapse)
    in ModelCollapse (created by Models)
    in div (created by Models)
    in div (created by NoMargin)
    in NoMargin (created by Collapse)
    in Collapse (created by Models)
    in section (created by Models)
    in Models (created by _class)
    in _class (created by Connect(_class))
    in Connect(_class) (created by BaseLayout)
    in section (created by Col)
    in Col (created by BaseLayout)
    in div (created by Row)
    in Row (created by BaseLayout)
    in div (created by BaseLayout)
    in div (created by BaseLayout)
    in BaseLayout (created by _class)
    in _class (created by Connect(_class))
    in Connect(_class)
    in section (created by Container)
    in Container
    in StandaloneLayout (created by _class)
    in _class (created by Connect(_class))
    in Connect(_class) (created by App)
    in App (created by _class)
    in _class (created by Connect(_class))
    in Connect(_class) (created by _class2)
    in Provider (created by _class2)
    in _class2

To reproduce...

Steps to reproduce the behavior:

  1. Go to '...'

  2. Click on '....'

  3. Scroll down to '....'

  4. See error

  5. Start the swagger petstore demo locally

  6. Navigate to http://localhost:3200/

  7. Scroll down to the Modal-section

  8. Click on a Modal-element (e.g. Order)

  9. Open your browsers dev-console

Expected behavior

There is no warning shown.

Screenshots
swagger-ui warning
Additional context or thoughts

This may be related to the fix of the following bug: https://github.com/swagger-api/swagger-ui/issues/4291

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 the local Swagger Petstore demo and open a model such as Order while watching the browser console. Trace the warning from the Model and ModelWrapper entries in the reported stack, then verify that opening models no longer emits the invalid schema prop-type warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.