NAME

XAS::Service::CheckParameters - A mixin to check parameters.

SYNOPSIS

my $valids;
my $params = {
    start => 1,
    limit => 25
};

if ($valids = $self->check_parameters($params, 'pager')) {

    while (my ($key, $value) = each(%$valids)) {

        printf("key: %s, value: %s\n", $key, $value);

    }

}

DESCRIPTION

This is a mixin routine to help with checking Data::FormValidator parameters. It expects a "profile" method to be defined. Exceptions are thrown, and the message is a JSON data structure of the errors.

check_parameters($params, $type)

A basic validation routine. It returns a hashref of valid parmeters and there values. It accepts these parameters.

$params

A hashref of parameters to check.

$type

The profiles type to check against.

SEE ALSO

XAS::Service
XAS

AUTHOR

Kevin L. Esteb, <kevin@kesteb.us>

COPYRIGHT AND LICENSE

Copyright (c) 2012-2016 Kevin L. Esteb

This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.