python-jsonschema / check-jsonschema

A CLI and set of pre-commit hooks for jsonschema validation with built-in support for GitHub Workflows, Renovate, Azure Pipelines, and more!
https://check-jsonschema.readthedocs.io/en/stable
Other
191 stars 38 forks source link

Allow validating YAML with inline yaml-language-server comments #340

Open Destroy666x opened 8 months ago

Destroy666x commented 8 months ago

As title says, e.g.:

# yaml-language-server: $schema=https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json

Pretty sure that's the most common way of describing schemas in YAML as of today. Would be nice to support it.

sirosen commented 8 months ago

I'm not familiar with this usage pattern, so I'll have to read up. This feels similar to #310.

It's likely that I'll first tackle #310 without including this, but I'll keep it in mind as a future use-case to make sure I leave room for it.

vorburger commented 5 months ago

I'm not familiar with this usage pattern, so I'll have to read up.

@sirosen FYI this is (possibly among others, I'm not 100% sure myself!) popular for folks (incl. me..) who use https://github.com/redhat-developer/vscode-yaml?tab=readme-ov-file#associating-a-schema-in-the-yaml-file. HTH!