henzen has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use Brannigan; use JSON; use Data::Dumper; my $json = q| { "method": "xxx", "backend": { "client": "mytest009", "pw": "sdkjfhsfjhKJH87" }, "blah": "123" # Junk }|; my $data = decode_json($json); my $b = Brannigan->new({ name => 'jsonPost', params => { method => { required => 1, one_of => ['xxx', ], }, backend => { hash => 1, keys => { client => { required => 1 }, pw => { required => 1 }, } }, } }); my $result = $b->process('jsonPost', $data); if ($result->{_rejects}) { print "ERROR\n"; print Dumper $result->{_rejects}, "\n"; } else { print "OK\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Brannigan: hash validation
by AnomalousMonk (Archbishop) on Feb 14, 2018 at 12:51 UTC | |
|
Re: Brannigan: hash validation
by 1nickt (Canon) on Feb 14, 2018 at 13:28 UTC | |
by henzen (Acolyte) on Feb 15, 2018 at 06:17 UTC | |
by henzen (Acolyte) on Feb 15, 2018 at 10:03 UTC | |
by 1nickt (Canon) on Feb 15, 2018 at 13:47 UTC | |
|
Re: Brannigan: hash validation
by Anonymous Monk on Feb 14, 2018 at 14:23 UTC | |
by Your Mother (Archbishop) on Feb 14, 2018 at 19:13 UTC | |
by Anonymous Monk on Feb 14, 2018 at 19:56 UTC | |
by Anonymous Monk on Feb 14, 2018 at 23:24 UTC | |
by Your Mother (Archbishop) on Feb 15, 2018 at 00:59 UTC | |
by Anonymous Monk on Feb 15, 2018 at 11:54 UTC | |
by henzen (Acolyte) on Feb 15, 2018 at 10:55 UTC |