line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MinLength; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
36855
|
use strict; |
|
47
|
|
|
|
|
107
|
|
|
47
|
|
|
|
|
1296
|
|
4
|
47
|
|
|
47
|
|
254
|
use warnings; |
|
47
|
|
|
|
|
101
|
|
|
47
|
|
|
|
|
1332
|
|
5
|
47
|
|
|
47
|
|
247
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
91
|
|
|
47
|
|
|
|
|
280
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
2806
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
108
|
|
|
47
|
|
|
|
|
11691
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub instance_type() { INSTANCE_TYPE_STRING(); } |
10
|
|
|
|
|
|
|
sub keyword() { "minLength" } |
11
|
|
|
|
|
|
|
sub keyword_priority() { 10; } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub validate { |
14
|
16
|
|
|
16
|
0
|
39
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
16
|
|
|
|
|
73
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
16
|
100
|
|
|
|
74
|
if (length($instance) < $keyword_value) { |
19
|
5
|
|
|
|
|
23
|
$context->log_error("The instance length is less than minLength value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |