Thanks Toby. It probably can't be accomplished with a type. With a JSON Schema you can say about an object (Dict) that it must contain one of a list of (named) keys each with their own type. You could require either a phone number or an email address, for example. So something like:
my $check = compile(Dict[ foo => Str, oneOf => [ baz => Int, qux => Str, ], ]);
In reply to Re^2: Type::Tiny and anyOf, oneOf
by 1nickt
in thread Type::Tiny and anyOf, oneOf
by 1nickt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |