Swagger-ui: Opening a Model of the Swagger Petstore shows a warning in the console

Created on 28 May 2018  路  1Comment  路  Source: swagger-api/swagger-ui

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
  1. Start the swagger petstore demo locally
  2. Navigate to http://localhost:3200/
  3. Scroll down to the Modal-section
  4. Click on a Modal-element (e.g. Order)
  5. 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

user experience bug

Most helpful comment

Note that these warnings are only visible in development - actual builds of Swagger-UI don't show this issue. (The exception: folks using Swagger-UI in their own React applications will see these errors in the course of _their_ development)

Nonetheless, it's console noise that should be addressed 馃槃

>All comments

Note that these warnings are only visible in development - actual builds of Swagger-UI don't show this issue. (The exception: folks using Swagger-UI in their own React applications will see these errors in the course of _their_ development)

Nonetheless, it's console noise that should be addressed 馃槃

Was this page helpful?
0 / 5 - 0 ratings