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

Option to turn off schema enforcement for a single document via modeline

Open
#796 0 comments 2 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

Is your enhancement related to a problem? Please describe.

I have a YAML document in a format for which no accurate schema exists. (This is a Concourse pipeline, but https://github.com/cappyzawa/concourse-pipeline-jsonschema has some bugs with current Concourse releases).

When I don't specify any schema, the first element of my document has errors flagged: "Property resource_types is not allowed"; "Incorrect type. Expected one of array, null."

I don't know what the document is being compared against -- as there's no modeline specifying a type, I would have expected there to be no schema-based validation at all.

It's unclear to me whether turning off validation altogether also prevents validation for well-formedness; not knowing this, I'm hesitant to take that step.

Note that I use Helix, not VS Code.

Describe the solution you would like

It should be possible to specify something like # yaml-language-server: $schema=none to prevent any schema validation from taking place.

Describe alternatives you have considered

I have considered turning off validation altogether via global configuration.

Additional context

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 files or tests are named in the issue. Begin by locating modeline handling and schema-validation paths, then check existing validation tests; done should mean a document-level modeline can disable schema validation without disabling well-formedness checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, yaml
Domain
tooling
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.