Closed dnmfarrell closed 8 years ago
Pretty sure your schema is incorrect. Maybe you want something like this:
$validator->schema({
type => 'object',
properties => {
foo => {
type => 'object',
minProperties => 1,
properties => {
bar => {
type => 'integer'
}
},
},
},
});
Yes you're right. This does raise an error as expected:
#!/usr/bin/env perl
use strict;
use warnings;
use JSON::Validator;
my $validator = JSON::Validator->new;
$validator->schema({
type => 'object',
properties => {
bar => {
type => 'integer',
}
},
minProperties => 1,
});
print $validator->validate({ });
Thank you!
You're very welcome 😄
Hi,
I'm having trouble getting
minProperties
to be enforced:I'm running version 0.86 on Perl 5.22.0.