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

Bug in the recursive schema implementation #112

Open
rlouf opened this issue Dec 6, 2024 · 0 comments
Open

Bug in the recursive schema implementation #112

rlouf opened this issue Dec 6, 2024 · 0 comments
Labels
bug Something isn't working json schema

Comments

@rlouf
Copy link
Member

rlouf commented Dec 6, 2024

Let's consider the following recursive JSON Schema:

{
        "$schema": "http://json-schema.org/draft-07/schema#",
        "definitions": {
            "person": {
                "type": "object",
                "properties": {
                    "name": {"type": "string"},
                    "children": {
                        "type": "array",
                        "items": {"$ref": "#/definitions/person"},
                        "default": [],
                    },
                },
            }
        },
        "type": "object",
        "properties": {"person": {"$ref": "#/definitions/person"}},
    }

If we iterate over the tokens of the following (incomplete) possible generation:

 {"name": "Jae laalkdjfa Winfreed Martin Skye laksdjflksdj alkdjflkajds","children": [{ "name": "Jon Alabasterine Paphnose", "children": [{"name": "Aloysious Johtnose-Paphnose III"}]},{"name": "Pupling joainodf wllldfc ahjolds ujmkew Patriciaica Johnas Pumpernickle Invictis plalkasdf mendoza gillford-throuple jaiop ANoaenla"

we bump into a token that is not in the set of next allowed tokens. It might not be due to the recursive property of the schema, but we need to debug this nevertheless.

@rlouf rlouf added the bug Something isn't working label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working json schema
Projects
None yet
Development

No branches or pull requests

2 participants