Validate YAML string, which itself is YAML #2772
-
It's probably asked before, but I think use-case is missing from the docs, AFAICT. Is it possible to have a k8s yaml as the following:
I'd like to verify Of course in the above the first question is, why is Can Cuelang help in this case and help validate that the string |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Well I guess I Can't Tell that much, it's in the docs, though perhaps not explicit with the pipe-sign in the yaml. For search engine stragglers: import "encoding/yaml"
spec: values: yaml.Validate(#Annotations)
#Annotations:{
annotations: [string]: =~ "^(\\w+)(,\\s*\\w+)*$"
}
$ cue vet foo.yaml foo.cue
[exit code 0] |
Beta Was this translation helpful? Give feedback.
Well I guess I Can't Tell that much, it's in the docs, though perhaps not explicit with the pipe-sign in the yaml.
For search engine stragglers: