Replies: 3 comments
-
|
There's an interesting and somewhat subtle reason for this: because This is the reason we can add fields when embedding in examples like this: So, technically your example is similar to this CUE, which is legitimate: There does however seem to be a discrepancy between the treatment of YAML and CUE files on the command line. For example (using testscript to demo): Arrays behave a bit differently here, although they probably shouldn't. This seems like a bug. I don't actually know what the semantics of independent files on the command line are meant to be when there's no package. Do they all exist inside the same package (in which case your example is technically working as intended) or should they be treated as separate packages for the purposes of unification. I suspect that in your case it was important to verify that the top level YAML corresponded directly to the schema with no spelling mistakes in field names. I'm not aware of a way of doing that currently, but there may well be on that I haven't thought of. For now, the workaround would be to verify the YAML without the need to embed. One solution might be to use the |
Beta Was this translation helpful? Give feedback.
-
|
You can use |
Beta Was this translation helpful? Give feedback.
-
|
Hello 👋 , I recently ran into the same issue (see here), and noticed that both proposed workarounds help. But I'm not sure about the advantages/disadvantages of the two. The With the
(source) Any other points to consider? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm probably holding it wrong, but what I gathered from the tutorials the following should not be valid - I thought, that's what Closed structs are for. Anyway, here it goes:
items.cueitems.yamlI would expect that
cue vet items.cue items.yamlfails for the second item, becauseff: boolis not part of the#Itemdefinition, but it doesn't. The command executes successful. So, a) I'm doing something wrong, or b) it is expected, or c) #822 is addressing this. Which is it?Thanks in advance for the help!
Beta Was this translation helpful? Give feedback.
All reactions