wetzel
wetzel copied to clipboard
Relative `$ref`s are always resolved against root schema path (?)
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.