line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MaxItems; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
112452
|
use strict; |
|
47
|
|
|
|
|
1496
|
|
|
47
|
|
|
|
|
1441
|
|
4
|
47
|
|
|
47
|
|
248
|
use warnings; |
|
47
|
|
|
|
|
86
|
|
|
47
|
|
|
|
|
1504
|
|
5
|
47
|
|
|
47
|
|
37585
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
15256
|
|
|
47
|
|
|
|
|
343
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
2957
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
94
|
|
|
47
|
|
|
|
|
12555
|
|
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
|
41
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
22
|
|
|
|
|
78
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
22
|
100
|
|
|
|
78
|
if (scalar(@$instance) > $keyword_value) { |
19
|
6
|
|
|
|
|
25
|
$context->log_error("The instance array length is greater than maxItems value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |