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

Relative $refs are always resolved against root schema path (?) #83

Open
rijenkii opened this issue Jul 23, 2022 · 0 comments
Open

Relative $refs are always resolved against root schema path (?) #83

rijenkii opened this issue Jul 23, 2022 · 0 comments

Comments

@rijenkii
Copy link

I'm not sure if it's the intended behaviour, but it feels like it shouldn't be.

./main.json:

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "title": "main",
    "$ref": "./subdir/child1.json"
}

./subdir/child1.json:

{
    "title": "child1",
    "$ref": "../child2.json"
}

./child2.json:

{
    "title": "child2",
    "type": "string"
}

wetzel main.json fails with Error: Unable to find $ref ../child2.json, but works if I change the $ref in child1 to ./child2.json, as if child1 is located in the same directory as child2.

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

1 participant