line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MinProperties; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
37397
|
use strict; |
|
47
|
|
|
|
|
133
|
|
|
47
|
|
|
|
|
1331
|
|
4
|
47
|
|
|
47
|
|
248
|
use warnings; |
|
47
|
|
|
|
|
84
|
|
|
47
|
|
|
|
|
1311
|
|
5
|
47
|
|
|
47
|
|
238
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
79
|
|
|
47
|
|
|
|
|
264
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
3159
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
97
|
|
|
47
|
|
|
|
|
11924
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub instance_type() { INSTANCE_TYPE_OBJECT(); } |
10
|
|
|
|
|
|
|
sub keyword() { "minProperties" } |
11
|
|
|
|
|
|
|
sub keyword_priority() { 10; } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub validate { |
14
|
16
|
|
|
16
|
0
|
37
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
16
|
|
|
|
|
61
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
16
|
100
|
|
|
|
77
|
if (scalar keys %$instance < $keyword_value) { |
19
|
6
|
|
|
|
|
44
|
$context->log_error("The instance properties is less than minProperties value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |