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

stack overflow when using a recursive schema #40

Open
aatifsyed opened this issue Jun 27, 2024 · 0 comments
Open

stack overflow when using a recursive schema #40

aatifsyed opened this issue Jun 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@aatifsyed
Copy link

aatifsyed commented Jun 27, 2024

$ git show
commit f49845a5ec744073f7e7cc7e76117fb436147b4a (HEAD -> main, origin/main, origin/HEAD)
Merge: 1ac937e afb6949
Author: getsentry-bot <[email protected]>
Date:   Tue Jun 6 10:15:49 2023 +0000

    Merge branch 'release/0.1.7'

$ cat schema.json 
{
    "$ref": "#/definitions/recursive_array",
    "definitions": {
        "recursive_array": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/recursive_array"
            }
        }
    }
}
$ cargo run --quiet --features build-binary -- schema.json schema.json 

thread 'main' has overflowed its stack
fatal runtime error: stack overflow
Aborted

This precludes checking e.g ASTs which look like this:

{
  "$ref": "#/definitions/node",
  "definitions" {
    "node": {
      "type": "object",
      "properties": {
        "name:": { "type": "string" },
        "children": { "type": "array", "items": "#/definitions/node" },
      }
      "required": ["name", "children"]
  }
}
@untitaker untitaker added the bug Something isn't working label Sep 26, 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
Projects
None yet
Development

No branches or pull requests

2 participants