Skip to content

$schema prop #440

@johngeorgewright

Description

@johngeorgewright

Summary

Out of the box, VSCode will validate against whatever schema is referenced in a JSON document's $schema property; whether that is from a remote URL or a path relative to the JSON file.

Is there anything in the roadmap to feature the same in vscode-yaml?

Relevant information

Here's an example of VSCode using a relative schema (with the $schema prop)

VSCode with 2 open editors side by side.

I found the option to reference the schema from a comment at the top of a YAML file, but I can't seem to get that to work very nicely with local schemas.

... I've tried using a path relative to the root:

Screenshot 2021-03-03 at 22 56 21

... and I've tried relative to the file:

Screenshot 2021-03-03 at 22 57 01

Screenshot 2021-03-03 at 22 57 07

Even if I got one of the above options to work, the comment would be stripped out if I were to convert the YAML file to JSON, so doesn't quite suite my needs anyway 😞 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions