Describe the bug
I'm actually not sure if it's a schema issue but it looks fine. If I'm mistaken, sorry!
It seems the language server doesn't properly support string enum arrays.
I'm using the following schema: https://raw.githubusercontent.com/aquasecurity/trivy/main/schema/trivy-config.json
This fragment is relevant:
"severity": {
"items": {
"type": "string"
},
"type": "array",
"enum": [
"UNKNOWN",
"LOW",
"MEDIUM",
"HIGH",
"CRITICAL"
],
"description": "severities of security issues to be displayed"
},
When I use the following fragment in my yaml:
# yaml-language-server: $schema=https://raw.githubusercontent.com/aquasecurity/trivy/main/schema/trivy-config.json
severity:
- MEDIUM
Expected Behavior
No errors happen, since MEDIUM is value in the enum.
Current Behavior
I see the following error: Value is not accepted. Valid values: "UNKNOWN", "LOW", "MEDIUM", "HIGH", "CRITICAL".
Quoting "MEDIUM" or using alternative YAML array syntaxes doesn't work either.
Steps to Reproduce
- Paste my example YAML into a new file.
- Observe the issue.
Environment
Extension version: 1.19.1
Thanks for your work, this extension is invaluable 🙇
Describe the bug
I'm actually not sure if it's a schema issue but it looks fine. If I'm mistaken, sorry!
It seems the language server doesn't properly support string enum arrays.
I'm using the following schema: https://raw.githubusercontent.com/aquasecurity/trivy/main/schema/trivy-config.json
This fragment is relevant:
When I use the following fragment in my yaml:
Expected Behavior
No errors happen, since
MEDIUMis value in the enum.Current Behavior
I see the following error:
Value is not accepted. Valid values: "UNKNOWN", "LOW", "MEDIUM", "HIGH", "CRITICAL".Quoting
"MEDIUM"or using alternative YAML array syntaxes doesn't work either.Steps to Reproduce
Environment
Extension version: 1.19.1
Thanks for your work, this extension is invaluable 🙇