Skip to content

Validate related fields in a cue schema? #1143

Answered by verdverm
cbrgm asked this question in Q&A
Discussion options

You must be logged in to vote

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)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@cbrgm
Comment options

@myitcv
Comment options

Answer selected by cbrgm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants