redhat-developer / redhat-developer/yaml-language-server
enable schema self identification using inline $schema
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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