line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MaxLength; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
21499
|
use strict; |
|
47
|
|
|
|
|
54
|
|
|
47
|
|
|
|
|
1188
|
|
4
|
47
|
|
|
47
|
|
145
|
use warnings; |
|
47
|
|
|
|
|
49
|
|
|
47
|
|
|
|
|
968
|
|
5
|
47
|
|
|
47
|
|
136
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
50
|
|
|
47
|
|
|
|
|
177
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
1905
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
61
|
|
|
47
|
|
|
|
|
8106
|
|
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
|
31
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
26
|
|
|
|
|
60
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
26
|
100
|
|
|
|
61
|
if (length($instance) > $keyword_value) { |
19
|
10
|
|
|
|
|
21
|
$context->log_error("The instance length is greater than maxLength value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |