Skip to content

"field is required but not present" never surfaces data files as positions #4248

@vytstank

Description

@vytstank

What version of CUE are you using (cue version)?

$ podman run -ti --rm cuelang/cue:latest version
cue version v0.15.4

CUE language version v0.15.4

Go version go1.25.6
      -buildmode exe
       -compiler gc
       -trimpath true
     CGO_ENABLED 0
          GOARCH arm64
            GOOS linux
         GOARM64 v8.0

Does this issue reproduce with the latest stable release?

Yes

What did you do?

Trying out some validation patterns to create schemas. Not sure if this is a bug or expected behavior, but sharing the case.

$ cat demo.yaml
type: cat
diet: chicken

$ cat demo.cue
name!:   string // All animals have a name.
type!:   string // Every animal must have a type.
height?: int    // Optional, as we haven't managed to measure *every* animal just yet.

$  podman run -ti --rm -v $(pwd):/workspace -w /workspace cuelang/cue:latest vet -c demo.cue demo.yaml
name: field is required but not present:
    ./demo.cue:1:1

What did you expect to see?

./demo.yaml: somewhere in addition to demo.cue

What did you see instead?

name: field is required but not present:
    ./demo.cue:1:1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions