redhat-developer / redhat-developer/yaml-language-server
Inconsistent behavior with inlined schemas
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 352
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 11
Description
Describe the bug
When using the inlined schemas the behavior is different vs when the schema is defined in the settings.
Expected Behavior
The behavior should be the same, doesn't matter if the user sets the schema inline or in configuration.
Current Behavior
The diagnostics do not work or are different.
Steps to Reproduce
- Start with a blank config and create a file with the following content:
# yaml-language-server: $schema=https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.4-standalone-strict/all.json
apiVersion: networking.k8s.io/v1
kind: Ingress
foo: bar
It doesn't trigger any diagnostics but autocompletion works.
- Configure the schema to apply to all YAML files in the settings:
{
"yaml.schemas": {
"https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.4-standalone-strict/all.json": "/*.yaml"
}
}
Create a file with the following content:
apiVersion: networking.k8s.io/v1
kind: Ingress
foo: bar
It triggers the expected diagnostics:
Property foo is not allowed.yaml-schema: https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.4-standalone-strict/_definitions.json
Environment
- Windows
- Mac
- Linux
- other (please specify)
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
Reproduce the two configurations described in the issue: an inline YAML schema directive and the same schema configured through yaml.schemas. Compare diagnostics while confirming that autocompletion continues to work; done means both schema sources produce the same expected diagnostic for the unsupported foo property.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100