Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Type::Tiny and anyOf, oneOf

by tobyink (Canon)
on Feb 04, 2021 at 21:54 UTC ( [id://11127899]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Type::Tiny and anyOf, oneOf
in thread Type::Tiny and anyOf, oneOf

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11127899]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-29 13:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found