line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MaxItems; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
66855
|
use strict; |
|
47
|
|
|
|
|
984
|
|
|
47
|
|
|
|
|
1227
|
|
4
|
47
|
|
|
47
|
|
165
|
use warnings; |
|
47
|
|
|
|
|
41
|
|
|
47
|
|
|
|
|
1180
|
|
5
|
47
|
|
|
47
|
|
18415
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
11297
|
|
|
47
|
|
|
|
|
213
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
2214
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
54
|
|
|
47
|
|
|
|
|
8399
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub instance_type() { INSTANCE_TYPE_ARRAY(); } |
10
|
|
|
|
|
|
|
sub keyword() { "maxItems" } |
11
|
|
|
|
|
|
|
sub keyword_priority() { 10; } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub validate { |
14
|
22
|
|
|
22
|
0
|
24
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
22
|
|
|
|
|
47
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
22
|
100
|
|
|
|
56
|
if (scalar(@$instance) > $keyword_value) { |
19
|
6
|
|
|
|
|
17
|
$context->log_error("The instance array length is greater than maxItems value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |