-
Originally opened by @NReilingh in cuelang/cue#887 I would like to define a struct that accomplishes the following:
Is this possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Original reply by @mpvl in cuelang/cue#887 (comment) With the API or in CUE directly? In CUE directly you can write:
Comparing against bottom is not specified in the spec, or at the very least it is poorly defined. I've written (but still need to publish) a relatively minor change, replacing this with builtins like In the API you can do a |
Beta Was this translation helpful? Give feedback.
Original reply by @mpvl in cuelang/cue#887 (comment)
With the API or in CUE directly?
In CUE directly you can write:
Comparing against bottom is not specified in the spec, or at the very least it is poorly defined. I've written (but still need to publish) a relatively minor change, replacing this with builtins like
isdefined(optional)
. But for now this works.In the API you can do a
LookupPath
and see whether the resulting value exists.