I read the documentation but couldn't find anything about using $refs and how they get resolved.
Consider the following definitions:
foo.schema.json
{
"$id": "https://someprefix/foo",
"title": "Foo",
"type": "object",
"properties": {
"bar": { "$ref": "bar#" }
},
"required": ["bar"]
}
bar.schema.json
{
"$id": "https://someprefix/bar",
"title": "Bar",
"type": "object",
"properties": {
"value": { "type": "string" }
},
"required": ["value"]
}
As you see the https://someprefix/foo schema depends on the https://someprefix/bar one. The reference to from foo to bar is performed via { "$ref": "bar#" }. Unfortunately it doesn't work with this plugin:
# yaml-language-server: $schema=./foo.schema.json
bar:
value: "hello"
results to a validation error:
Problems loading reference 'file:///projects/bar': Unable to load schema from '/projects/bar': No content.YAML(768)
Is there a way to load all the schemas from a directory to get this resolution working? This is how Ajv resolution works for example.
I read the documentation but couldn't find anything about using
$refs and how they get resolved.Consider the following definitions:
foo.schema.json
{ "$id": "https://someprefix/foo", "title": "Foo", "type": "object", "properties": { "bar": { "$ref": "bar#" } }, "required": ["bar"] }bar.schema.json
{ "$id": "https://someprefix/bar", "title": "Bar", "type": "object", "properties": { "value": { "type": "string" } }, "required": ["value"] }As you see the
https://someprefix/fooschema depends on thehttps://someprefix/barone. The reference to fromfootobaris performed via{ "$ref": "bar#" }. Unfortunately it doesn't work with this plugin:results to a validation error:
Is there a way to load all the schemas from a directory to get this resolution working? This is how
Ajvresolution works for example.