you wish to return this object as JSON then you must ensure
that you have configured the JSON serializer something like:
set engines => { serializer => { JSON => { convert_blessed => 1 } } };
my $params = params;
my $data = validator( $params, 'rules1' );
send_as JSON => $data;
};
=head1 CONFIGURATION
The following configuration settings are available (defau
$self->errors;
}
}
=head2 TO_JSON
Returns a hash reference of L</valid> and L</values>, and if L</valid> is
false also adds L</css> and L</errors>.
If L<JSON> serializer has C<convert_blesssed
rue value, then
this method is called automatically on object before serialization.
=cut
sub TO_JSON {
my $self = shift;
return +{
map { $_ => $self->$_ }
$self->valid ? (q