hofstadter-io / cuetils

CLI and library for diff, patch, and ETL operations on CUE, JSON, and Yaml
BSD 3-Clause "New" or "Revised" License
78 stars 6 forks source link

field not allowed: #content #38

Open sjwl opened 2 years ago

sjwl commented 2 years ago
// schema.cue
#a: {
  name: string
}
#a
# a.yaml
name: foo
> cuetils validate schema.cue a.yaml
a.yaml
----------------------
field not allowed: #content

Errors in 1 file(s)
> cuetils version  
cuetils ConfigDir "/Users/samlee/Library/Application Support/cuetils" <nil>

Version:     v0.4.0
Commit:      6263ed1672d52dfca3bb3cd7d5d27adfa102ec53

BuildDate:   2022-02-02T05:05:42Z
GoVersion:   go1.14
OS / Arch:   darwin amd64

Author:   Hofstadter, Inc
Homepage: https://docs.hofstadter.io
GitHub:   https://github.com/hofstadter-io/cuetils

Workaround

> cue vet schema.cue a.yaml
>
verdverm commented 2 years ago

generally, you wouldn't write a definition, to then embed it at the top level, rather just put the fields at the top level, not sure if this example is a simplification of a larger code base. You might try making it hidden?

I also don't really support this tool anymore, you can see the CUE version is out of date and most functionality has been moved to github.com/hofstadter-io/hof