jio
jio copied to clipboard
Make key required when a different key has specific value?
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.