Differing behaviour between cue eval
and yaml.Unmarshal
and hidden fields?
#976
Replies: 3 comments 2 replies
-
I expected The following is an interesting example, perhaps meaning the parser needs to be adjusted?
data:
_hid: foo
"_hid": 1
data: {
_hid: string
"_hid": int
} Not sure the exact answer to your original question, could be some interplay of the YAML parser(s), hidden fields, and/or when the values are unified in the tool subsystem |
Beta Was this translation helpful? Give feedback.
-
Just FTR: CUE supports multiple field types. The type that YAML and JSON supports are called regular fields in CUE. In summary, CUE supports:
Note that identifiers may start with |
Beta Was this translation helpful? Give feedback.
-
This discussion has been migrated to cue-lang/cue#976. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
-
I was testing how hidden fields behave when originating from yaml files and I'm confused by the differing behaviour between these two examples. I would expect them to give the same output but using
yaml.Unmarshal
gives an error.foo.yaml
:foo.cue
:the output of
cue eval foo.cue foo.yaml
is:(cue version 0.4.0-beta.1 darwin/amd64)
However when I attempt the following I get an error.
foo_tool.cue
:the output is:
I would have expected them both to behave the same. is there something I'm misunderstanding here? or am I doing something wrong? (I'm obviously new to cue)
Beta Was this translation helpful? Give feedback.
All reactions