Something like this:
my $type = Dict->of( foo => Str, baz => Optional[Int], qux => Optional[Str], )->where(q{ exists $_->{baz} or exists $_->{qux} }); if ( $type->check( \%somehash ) ) { say "matched"; }
Also, might be worth looking into JSON-Schema-AsType.
In reply to Re^3: Type::Tiny and anyOf, oneOf
by tobyink
in thread Type::Tiny and anyOf, oneOf
by 1nickt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |