github.com/solo-io/cue@v0.4.7/doc/tutorial/basics/0_intro/47_validation.txt (about)

     1  ! cue vet schema.cue data.yaml
     2  cmp stderr expect-stderr
     3  
     4  -- frontmatter.toml --
     5  title = "Validation"
     6  description = ""
     7  
     8  -- text.md --
     9  Constraints can be used to validate values of concrete instances.
    10  They can be applied to CUE data, or directly to YAML or JSON.
    11  
    12  -- schema.cue --
    13  #Language: {
    14  	tag:  string
    15  	name: =~"^\\p{Lu}" // Must start with an uppercase letter.
    16  }
    17  languages: [...#Language]
    18  
    19  -- data.yaml --
    20  languages:
    21    - tag: en
    22      name: English
    23    - tag: nl
    24      name: dutch
    25    - tag: no
    26      name: Norwegian
    27  
    28  -- expect-stderr --
    29  languages.1.name: invalid value "dutch" (does not match =~"^\\p{Lu}"):
    30      ./schema.cue:3:8
    31      ./data.yaml:5:12