Swagger: Could not render this component, see the console.

See original GitHub issue

After the last update I’m getting this error ‘Could not render this component, see the console.’ when try to view the Responses.

This error that I get on the console

TypeError: Cannot read property 'anyOf' of undefined
    at e (swagger-ui-bundle.js:24)
    at e (swagger-ui-bundle.js:24)
    at e (swagger-ui-bundle.js:24)
    at e (swagger-ui-bundle.js:24)
    at e (swagger-ui-bundle.js:24)
    at e (swagger-ui-bundle.js:24)
    at e (swagger-ui-bundle.js:24)
    at swagger-ui-bundle.js:89
    at t.getSampleSchema (swagger-ui-bundle.js:1)
    at t.value (swagger-ui-bundle.js:82)

I think that the problem is on this file https://github.com/api-platform/core/commits/master/src/Bridge/Symfony/Bundle/Resources/public/swagger-ui/swagger-ui-bundle.js because I revert back the file and my swagger is working fine.

screen shot 2018-07-26 at 2 07 52 pm

Thanks Luis

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:9

github_iconTop GitHub Comments

24reactions
Vivida1commented, Mar 11, 2020

For me the issue was: If you add a schema with type “array” but do not add the “items:” part, it will throw this error.

Throws error:

components:
  schemas:
    users:
      type: array

Works:

components:
  schemas:
    users:
      type: array
      items:
        type: object
        properties:
          id:
            type: string
          name:
            type: string
13reactions
bjellinecommented, Feb 14, 2020

For me the error message “Could not render this component, see the console.” appeared for each parameter. I could fix it by switching from using type to using schema:

    # parameter in: :path, name: :id, type: :integer # broken
    parameter in: :path, name: :id, schema: { type: :integer } # fixed
Read more comments on GitHub >

github_iconTop Results From Across the Web

swagger: is ' Could not render this component, see the ...
cURL command not rendered. In this example, the thing that could not be rendered is the cURL command. The issue was caused by...
Read more >
Could not render this component, see the consol...
I configured the parameter in header, but I get the error " Could not render this component, see the console." on the UI....
Read more >
is ' Could not render this component, see the console' an ...
I start swagger by opening the cmd prompt, cd into C:/swagger & then executing the 'npm start' command. I've attempted running the api...
Read more >
Swagger UI - Teamwork Cloud REST API Documentation
https://osmc.nomagic.com/19.0sp3/twc-rest-swagger.json. Teamwork Cloud REST API ... Could not render this component, see the console. Could not render ...
Read more >
Swagger Editor
This is a sample Pet Store Server based on. the OpenAPI 3.0 specification. You can. find out more about. Swagger at [https://swagger.io](https.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found