line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MinItems; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
36687
|
use strict; |
|
47
|
|
|
|
|
105
|
|
|
47
|
|
|
|
|
1254
|
|
4
|
47
|
|
|
47
|
|
244
|
use warnings; |
|
47
|
|
|
|
|
100
|
|
|
47
|
|
|
|
|
1319
|
|
5
|
47
|
|
|
47
|
|
265
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
93
|
|
|
47
|
|
|
|
|
269
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
2693
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
97
|
|
|
47
|
|
|
|
|
11459
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub instance_type() { INSTANCE_TYPE_ARRAY(); } |
10
|
|
|
|
|
|
|
sub keyword() { "minItems" } |
11
|
|
|
|
|
|
|
sub keyword_priority() { 10; } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub validate { |
14
|
26
|
|
|
26
|
0
|
52
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
26
|
|
|
|
|
112
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
26
|
100
|
|
|
|
96
|
if (scalar(@$instance) < $keyword_value) { |
19
|
10
|
|
|
|
|
46
|
$context->log_error("The instance array length is less than minItems value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |