line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MaxLength; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
36570
|
use strict; |
|
47
|
|
|
|
|
108
|
|
|
47
|
|
|
|
|
1316
|
|
4
|
47
|
|
|
47
|
|
247
|
use warnings; |
|
47
|
|
|
|
|
101
|
|
|
47
|
|
|
|
|
1265
|
|
5
|
47
|
|
|
47
|
|
241
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
95
|
|
|
47
|
|
|
|
|
307
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
2482
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
95
|
|
|
47
|
|
|
|
|
12079
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub instance_type() { INSTANCE_TYPE_STRING(); } |
10
|
|
|
|
|
|
|
sub keyword() { "maxLength" } |
11
|
|
|
|
|
|
|
sub keyword_priority() { 10; } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub validate { |
14
|
26
|
|
|
26
|
0
|
66
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
26
|
|
|
|
|
112
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
26
|
100
|
|
|
|
117
|
if (length($instance) > $keyword_value) { |
19
|
10
|
|
|
|
|
40
|
$context->log_error("The instance length is greater than maxLength value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |