I tried to create a YAML counterpart by copying the JSON guide, and simply swapping JSON (and its other cases) for YAML throughout the page.
I discovered that encoding/json.Extract() and encoding/yaml.Extract() aren't symmetric, being told that
./main.go:36:29: cannot use dataExpr (variable of type ast.File) as ast.Expr value in argument to ctx.BuildExpr: ast.File does not implement ast.Expr (missing method declNode)
This issue tracks the creation of that YAML counterpart.
In https://cuelang.org/cl/1194700 we added "How to validate JSON using the Go API".
I tried to create a YAML counterpart by copying the JSON guide, and simply swapping JSON (and its other cases) for YAML throughout the page.
I discovered that
encoding/json.Extract()
andencoding/yaml.Extract()
aren't symmetric, being told thatThis issue tracks the creation of that YAML counterpart.