redhat-developer / redhat-developer/vscode-yaml
Valid YML causes schema validation problems
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 830
- Forks
- 260
- Avg merge
- 5h 43m
- Merged PRs (30d)
- 1
Description
Describe the bug
I'm getting an Unexpected property validation error for a Google Cloud Workflows yaml file (actually all files of this type generate the same problem). The YAML file seems to be valid according to the schema (which I'm setting explicitly in the file). Disabling the validation doesn't work either.
It looks like this has to do with the top level property, the validation works just fine (and detects real problems) in the rest of the file and I can also disable the validation in those parts.
Expected Behavior
No validation error should be generated.
Current Behavior
There's an incorrect Unexpected property for the top level property.
Steps to Reproduce
See below the snippet that causes this problem (although all my workflows files have the same behavior):
# yaml-language-server: $schema=https://www.schemastore.org/workflows.json
main:
params: [input]
steps:
- init:
assign:
- message: "Hello World"
- count: 0
- check_condition:
switch:
- condition: ${count < 5}
next: log_message
next: finish
- log_message:
call: sys.log
args:
text: ${message + " " + count}
severity: "INFO"
next: increment
- increment:
assign:
- count: ${count + 1}
next: check_condition
- finish:
return: ${"Done. Counted to " + count}
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
Start with the provided Google Cloud Workflows YAML snippet and the referenced workflows.json schema, then trace how the top-level property is validated and why validation cannot be disabled there. Done means the valid workflow produces no false Unexpected property error while genuine nested validation errors and disabling validation continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode, yaml
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100