redhat-developer / redhat-developer/vscode-yaml

Adding support for custom vocabularies

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

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
829
Forks
260
Avg merge
5h 43m
Merged PRs (30d)
1

Description

Is your enhancement related to a problem? Please describe.

I would like to use VSCode-YAML to edit a file where one of the properties is an enum whose value must appear as another property in the same document. An example of the file I would like to edit is here: https://github.com/json-schema-org/json-schema-spec/issues/706

After much searching on the JSON schema github site, most of the closed issues are around the rejected $data idea. It appears that the accepted way to do this is with a custom vocabulary: https://github.com/json-schema-org/json-schema-vocabularies

There is one particular vocabulary that would implement this validation: https://gregsdennis.github.io/json-everything/usage/vocabs-data.html

It has a C# reference implementation, but not a JS one.

Describe the solution you would like

To know what plans VSCode-YAML has for supporting custom vocabularies, either natively or via an extension, and to implement this particular one.

Describe alternatives you have considered

I considered writing an extension to just handle my use-case, but thought I'd ask to see if anyone had thought about custom vocabularies in general

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

Start with the VSCode-YAML repository and the linked JSON Schema custom-vocabulary and json-everything documentation. Compare the requested same-document enum validation with the project's current support, then determine whether native support or an extension is the intended scope. Done means an agreed implementation path or support for the cited vocabulary, with validation demonstrated on the example document.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.