swagger-api / swagger-api/swagger-ui
Opening a Model of the Swagger Petstore shows a warning in the console
Nobody has claimed this yet.
- 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:
-
Go to '...'
-
Click on '....'
-
Scroll down to '....'
-
See error
-
Start the swagger petstore demo locally
-
Navigate to http://localhost:3200/
-
Scroll down to the Modal-section
-
Click on a Modal-element (e.g. Order)
-
Open your browsers dev-console
Expected behavior
There is no warning shown.
Screenshots
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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