Default values allow CUE to decide which element of a disjunction should be chosen when a configuration doesn’t specify a value, leaving more than one of the disjunction’s elements as valid options.
A default value is an element in a disjunction that has been prefixed with the
preference marker *
.
CUE will select and use the default when a value is required but none has been explicitly specified.
file.cue
#def: string | int | *1
A: #def
B: #def & 42
C: #def & "foo"
TERMINAL
$ cue export file.cue
{
"A": 1,
"B": 42,
"C": "foo"
}