line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MinLength; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
21826
|
use strict; |
|
47
|
|
|
|
|
63
|
|
|
47
|
|
|
|
|
1076
|
|
4
|
47
|
|
|
47
|
|
144
|
use warnings; |
|
47
|
|
|
|
|
53
|
|
|
47
|
|
|
|
|
941
|
|
5
|
47
|
|
|
47
|
|
129
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
57
|
|
|
47
|
|
|
|
|
173
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
1892
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
62
|
|
|
47
|
|
|
|
|
8005
|
|
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
|
19
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
16
|
|
|
|
|
44
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
16
|
100
|
|
|
|
37
|
if (length($instance) < $keyword_value) { |
19
|
5
|
|
|
|
|
13
|
$context->log_error("The instance length is less than minLength value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |