redhat-developer / redhat-developer/yaml-language-server

enable schema self identification using inline $schema

Open
#437 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
1.5k
Forks
352
Avg merge
2d 7h
Merged PRs (30d)
11

Description

JSON schema allows a JSON file to self identify its schema using the $schema key. This should also be possible with YAML.

without first saving to a file, $schema should enable validation and auto-completion

$schema: https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json
version: '3'
services:
  hello:
    image: hello-world

Further, this should enable use of local schema files.
For example, using the product catalog example from https://json-schema.org/learn/getting-started-step-by-step.html
If I were to save the final product catalog JSON schema locally to /usr/shared/productCatalog.json
I can then implement a product catalog with validation and auto-completion:

$schema: /usr/shared/productCatalog.json
productId: 123
productName: "self identify YAML schema"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files or tests are named. Start by reviewing the language server's existing schema-resolution behavior, then check how the inline $schema examples should work for unsaved YAML and local or remote schema paths. Done means validation and auto-completion use the referenced schema without first saving the document.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.