Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recursive $ref iteration #126

Open
Shairp opened this issue Apr 24, 2018 · 2 comments
Open

recursive $ref iteration #126

Shairp opened this issue Apr 24, 2018 · 2 comments

Comments

@Shairp
Copy link

Shairp commented Apr 24, 2018

Hello
I have json schema with recursive $ref iteration, for example:


{
    "definitions": {
        "TPNode": {
            "title": "TPNode",
            "description": "TPNode",
            "type": "object",
            "properties": {
                "selector": {
                    "type": "string",
                    "required": true
                }, 
                "attributes": {
                    "type": "array",
                    "items": {
                        "title": "Attribute",
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "value": {
                                "type": "string"
                            }
                        }
                    }
                },
                "children": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/TPNode"
                    }
                },
                "events": {
                    "type": "array",
                    "items": { 
                        "title": "Event",
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string"
                            },
                            "handler": {
                                "type": "object"
                            },
                            "dependencies": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "$ref": "#/definitions/TPNode"
}

when I am using this project with the json schema above then the create form button not working and I am getting "maximum call stack size exceeded" in the browser DevTool
can some one help me and fix this bug?

Shai

@OYE93
Copy link

OYE93 commented Nov 2, 2018

hi did you solve this problem?

@marcmalerei
Copy link

I am getting the same error.

{ "$schema": "http://json-schema.org/draft-03/schema#", "$ref": "#/definitions/data", "definitions" : { "data" : { "type" : "object", "properties" : { "menu" : { "$ref" : "#/definitions/menu" } }, "required" : ["menu"] }, "menu" : { "title" : "menu", "type" : "array", "items" : { "$ref" : "#/definitions/item" }, "minItems" : 1 }, "item" : { "title" : "menuitem", "type" : "object", "properties" : { "item" : { "type" : "string", "title" : "itemtext", "default" : "item" }, "href" : { "type" : "string", "title" : "itemhref", "default" : "/de" }, "menu" : { "title" : "menu", "oneOf" : [ { "title" : "no childs", "type":"null" }, { "$ref" : "#/definitions/menu" } ] } } } } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants