jio icon indicating copy to clipboard operation
jio copied to clipboard

Make key required when a different key has specific value?

Open klingelschmidt opened this issue 11 months ago • 0 comments

Is it possible to make an optional key required when a different key is set to a value? I though it could maybe be like this:

"datasource":   jio.String().Valid("foo", "bar").Required(),

"id":           jio.Number().When("datasource", "bar", jio.Number().Integer().Required()),

But it did not seem to work.

klingelschmidt avatar Jan 29 '25 07:01 klingelschmidt