koorchik / Validator-LIVR

Lightweight Perl validator supporting Language Independent Validation Rules Specification (LIVR)
https://metacpan.org/pod/Validator::LIVR
13 stars 4 forks source link

"not_empty" rule does not return an error if field exist, but undef #1

Open DanielHreben opened 11 years ago

DanielHreben commented 11 years ago

Validation rules:

my $rules = {
        some_field => [ 'not_empty' ],
};

Input hash:

my $data = {
        some_field => undef,
};

In this case, we must get an error, but validation rule did not see difference between hash with 'some_field' => undef, and hash where 'some_field' not exist

koorchik commented 11 years ago

I think we should remove all undfined values from data. So, undef will be treated as not existing field.