Subject: | Bug : Result not as expected. |
Date: | Wed, 15 Feb 2017 18:11:29 +0000 |
To: | "bug-Data-Validate-XSD [...] rt.cpan.org" <bug-Data-Validate-XSD [...] rt.cpan.org> |
From: | Amarendra Pramanik <apramanik [...] sis-emea.com> |
Hi,
I am facing issue while validating the data against the structure $def. Even if the data for BS_INFO_CALLED_NUM_FIELD_REF(string)not matching with the data type, the output showing success parsing. Will you please check what is the issue and why the validation is not happing.
$def = {
root => [
{ name => 'XDRAttributes', type => 'XDR' },
],
complexTypes => {
XDR => [
{ name => 'BS_INFO_CALLED_NUM_FIELD_REF', type => 'integer', minLength =>5, maxLength => 38 },
{ name => 'BS_INFO_DIAL_DIGITS_FIELD_REF', type => 'integer', minLength =>0, maxLength => 38 },
{ name => 'BUSINESS_INFO_BS_ID', type => 'integer', minLength =>0, maxLength => 38 },
{ name => 'BUSINESS_INFO_BS_VERSION', type => 'integer', minLength =>0, maxLength => 38 },
],
},
};
$data = {
XDRAttributes => {
BS_INFO_CALLED_NUM_FIELD_REF => 'hhffl',
}
};
my $validator = Data::Validate::XSD->new( $def );
$validator->setStrict( 1 );
my $errors = $validator->validate( $data );
warn Dumper($errors) if $errors;
BR/
Amarendra