vscode-yaml icon indicating copy to clipboard operation
vscode-yaml copied to clipboard

Referenced schemas don't seem to be using base URL?

Open jstafford5380 opened this issue 3 years ago • 0 comments

Summary

Schemas don't seem to follow child references relative to parent reference base uri

Relevant information

I have a as schema that has some properties referencing other schemas via $ref using a relative path. But the document I'm trying to validate is returning an error stating that schema could not be loaded and the path that it shows seems to be relative to root, not relative to the first schema. For example

  • Doc uses $schema=c:\user\me\docs\foo.schema.json
  • foo.schema.json has a property reference "$ref": "bar.schema.json"
  • Doc shows a validation error 'Problems loading reference 'file:///bar.schema.json': Unable to load schema from \bar.schema.json`: No content.

The schema files are co-located; same directory.

I'm not sure if I'm doing something wrong or if it's not supported or a bug or what

jstafford5380 avatar May 18 '22 16:05 jstafford5380