question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Recursive rendering needs work

See original GitHub issue

Hello,

I have the following model definitions spec:

    "definitions": {
        "models.Equipment": {
            "title": "Equipment",
            "type": "object",
            "properties": {
                "Features": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Feature"
                    }
                },
                "Id": {
                    "type": "integer",
                    "format": "int64"
                },
                "IdType": {
                    "type": "string"
                },
                "Name": {
                    "type": "string"
                },
                "Price": {
                    "type": "integer",
                    "format": "int32"
                }
            }
        },
        "models.Feature": {
            "title": "Feature",
            "type": "object",
            "properties": {
                "Equipments": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Equipment"
                    }
                },
                "Id": {
                    "type": "integer",
                    "format": "int64"
                },
                "IdFeature": {
                    "$ref": "#/definitions/models.Feature"
                },
                "Name": {
                    "type": "string"
                }
            }
        }
    }

In the Feature model, the Equipments property is defined as an array of Equipment models, but Swagger UI 3.x renders it as an empty array []. Everywhere Feature model is used, like as examples for POST method in Feature I have this kind of display.

swagger-ui bug

We think it may be a bug caused by circular references. Thanks to Helen.

Thank you very much!

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:29
  • Comments:51 (10 by maintainers)

github_iconTop GitHub Comments

11reactions
tobymurraycommented, Oct 3, 2017

Just ran into this as well using the OpenAPI 3 spec:

{
  "openapi": "3.0.0",
  "info": {
    "title": "Circular reference example",
    "version": "0.1"
  },
  "paths": {},
  "components": {
    "schemas": {
      "SelfReferencingSchema": {
        "type": "object",
        "properties": {
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SelfReferencingSchema"
            }
          }
        }
      }
    }
  }
}

Yields the following: image

I’m not familiar with the history or previous implementations of this or what’s possible/hard, but personally I think it’d be nice to show the title for a circular reference but not expand it by default. E.g.: image

10reactions
mristincommented, Jul 27, 2022

Hi, I’d like to have a try at fixing this as it is critical feature for us with many users. Does anybody know whether somebody else is working on this, or what a good entry point for this problem would be?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Recursive rendering | High Definition RP | 7.1.8 - Unity - Manual
This feature is a replacement pipeline for rendering Meshes in the High Definition Render Pipeline (HDRP). GameObjects that use this rendering mode cast ......
Read more >
Error "recursive rendering detected" when rendering media 20 ...
It works by keeping track of a static counter and aborting rendering when the counter reaches 20. Unfortunately this prevents legitimate use ...
Read more >
UI Recursive rendering development | Blog
I called it UI recursive rendering . ... And as we hover on sub menu's label, the child will be rendered on demand....
Read more >
Recursive Rendering with React Components
A complete guide for rendering nested data structures. ... Recursive rendering of a React component. As you can see, MyComponent is rendered ......
Read more >
Recursive rendering of components at all levels - Stack Overflow
I need help in to recursively render the components at all levels. There are Nodes at top level and then the same structure...
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