er(validation_json => sub {
my ($c) = @_;
my $v = $c->validation;
my $json = $c->req->json || { };
$json = { } unless ref $json eq 'HASH';
for my $key (keys %$json) {
my $
ot ref $json->{$key}) { $success = 1 }
elsif (ref $json->{$key} eq 'ARRAY') {
# Success only if there are no any refs in array
$success = 1 unless grep { ref $_ } @{$json->{$key
}};
}
$v->input->{$key} = $json->{$key} if $success;
}
return $v;
});
my $reply_headers = sub {
my ($c, $headers, $message) = @_;
$headers->{$conf->{header_message}