-
hey, I’m trying my hand at a cue schema to validate a configuration.
is it possible to define dependencies between fields? AC:
Does anyone have an example? |
Beta Was this translation helpful? Give feedback.
Answered by
verdverm
Jul 26, 2021
Replies: 1 comment 2 replies
-
You can use a disjunction like this https://cuelang.org/play/?id=weHb_EEW-N3#cue@export@yaml (note how I had to explicitly close the empty struct value) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
cbrgm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use a disjunction like this
#XOR: {} | {a: _, b: _}
, however care has to be taken with fields and values generally.https://cuelang.org/play/?id=weHb_EEW-N3#cue@export@yaml (note how I had to explicitly close the empty struct value)