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

Nested hierarchy without explicit leaf #40

Closed
rodjan opened this issue May 20, 2014 · 2 comments
Closed

Nested hierarchy without explicit leaf #40

rodjan opened this issue May 20, 2014 · 2 comments
Labels

Comments

@rodjan
Copy link

rodjan commented May 20, 2014

Hello,
I have a nested hierarchy and I don't want to explicitly define the last item as was done in #22. When I remove the oneOf construct it seems to end in an infinite loop.

This is the json/schema exhibiting the issue:
JSON

{ "is_start": true,
    "hierarchy": {
        "is_and": false,
        "filters": [
            {
                "is_and": false,
                "filters": [
                    {
                        "is_and": true,
                        "filters": [
                            {
                                "is_and": true,
                                "filters": [
                                    {
                                        "is_and": true,
                                        "filters": [
                                            {
                                                "is_and": true,
                                                "filters": [
                                                    {
                                                        "is_and": true,
                                                        "filters": []
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }}

SCHEMA

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Product set",
    "is_start": "boolean",
    "hierarchy": {
        "$ref": "#/definitions/recursion"
    },
    "definitions": {
        "recursion": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "is_and": {
                    "type": "boolean"
                },
                "filters": {
                    "type": "array",
                    "additionalItems": false,
                    "items": {
                        "$ref": "#/definitions/recursion"
                    }
                }
            }
        }
    }
}
@rodjan rodjan closed this as completed May 20, 2014
@rodjan rodjan reopened this May 20, 2014
@zaggino zaggino added bug and removed bug labels Jun 12, 2014
zaggino added a commit that referenced this issue Jun 15, 2014
@zaggino
Copy link
Owner

zaggino commented Jun 15, 2014

npm http PUT https://registry.npmjs.org/z-schema
+ z-schema@2.4.8

This issue should be fixed now, it's logged in testcase
https://github.com/zaggino/z-schema/blob/master/test/issue_40.js

@rodjan
Copy link
Author

rodjan commented Jul 26, 2014

Great job! Your validator is the best one on the market.

@rodjan rodjan closed this as completed Jul 26, 2014
zaggino added a commit that referenced this issue Aug 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants