in reply to Type::Tiny and anyOf, oneOf

Not directly answering your question, but have you considered Cpanel::JSON::XS::Type?
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Type::Tiny and anyOf, oneOf
by 1nickt (Canon) on Feb 02, 2021 at 14:36 UTC

    Thanks choroba, I was not aware of this module. Looks like it could be useful, but in this case I am not producing or deserializing JSON, just wanting to validate a subroutine's args.

    The way forward always starts with a minimal test.