line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MinItems; |
2
|
|
|
|
|
|
|
|
3
|
44
|
|
|
44
|
|
30713
|
use strict; |
|
44
|
|
|
|
|
85
|
|
|
44
|
|
|
|
|
1024
|
|
4
|
44
|
|
|
44
|
|
202
|
use warnings; |
|
44
|
|
|
|
|
83
|
|
|
44
|
|
|
|
|
1126
|
|
5
|
44
|
|
|
44
|
|
197
|
use parent qw(JSV::Keyword); |
|
44
|
|
|
|
|
84
|
|
|
44
|
|
|
|
|
264
|
|
6
|
|
|
|
|
|
|
|
7
|
44
|
|
|
44
|
|
2218
|
use JSV::Keyword qw(:constants); |
|
44
|
|
|
|
|
74
|
|
|
44
|
|
|
|
|
9622
|
|
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
|
|
|
|
|
98
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
26
|
100
|
|
|
|
86
|
if (scalar(@$instance) < $keyword_value) { |
19
|
10
|
|
|
|
|
32
|
$context->log_error("The instance array length is less than minItems value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |