-
Originally opened by @gogommartin in cuelang/cue#399 Hi! 👋 I'm looking for a way to specify a list value that always contains a default value in descendant lists. I've found 2 ways that work, but they both feel cumbersome as the author of the descendant list has to be aware of the default value and explicitly include it for it to work properly. In the example below, is there a way to make option "d" work?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Original reply by @myitcv in cuelang/cue#399 (comment) Probably the simplest way to do this for now is as follows:
This has the added advantage that when CUE supports embedded scalars the
(with some variation because the concatenation of lists might well change to be defined in terms of list comprehensions). |
Beta Was this translation helpful? Give feedback.
Original reply by @myitcv in cuelang/cue#399 (comment)
Probably the simplest way to do this for now is as follows:
This has the added advantage that when CUE supports embedded scalars the
res
field can be dropped and this example would become:(with some variation because the concatenation of lists might well change to be defined in terms of list comprehensions).