line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::Minimum; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
21723
|
use strict; |
|
47
|
|
|
|
|
63
|
|
|
47
|
|
|
|
|
1046
|
|
4
|
47
|
|
|
47
|
|
144
|
use warnings; |
|
47
|
|
|
|
|
51
|
|
|
47
|
|
|
|
|
901
|
|
5
|
47
|
|
|
47
|
|
128
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
64
|
|
|
47
|
|
|
|
|
177
|
|
6
|
47
|
|
|
47
|
|
1803
|
use JSON; |
|
47
|
|
|
|
|
49
|
|
|
47
|
|
|
|
|
210
|
|
7
|
|
|
|
|
|
|
|
8
|
47
|
|
|
47
|
|
3902
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
59
|
|
|
47
|
|
|
|
|
9088
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub instance_type() { INSTANCE_TYPE_NUMERIC(); } |
11
|
|
|
|
|
|
|
sub keyword() { "minimum" } |
12
|
|
|
|
|
|
|
sub keyword_priority() { 10; } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub validate { |
15
|
55
|
|
|
55
|
0
|
70
|
my ($class, $context, $schema, $instance) = @_; |
16
|
|
|
|
|
|
|
|
17
|
55
|
|
|
|
|
149
|
my $minimum = $class->keyword_value($schema); |
18
|
55
|
|
66
|
|
|
117
|
my $exclusive_minimum = $class->keyword_value($schema, "exclusiveMinimum") || JSON::false; |
19
|
|
|
|
|
|
|
|
20
|
55
|
100
|
|
|
|
497
|
if ($exclusive_minimum) { |
21
|
11
|
100
|
|
|
|
76
|
if ($instance <= $minimum) { |
22
|
7
|
|
|
|
|
16
|
$context->log_error("The instance value is less than or equals minimum keyword value"); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
else { |
26
|
44
|
100
|
|
|
|
248
|
if ($instance < $minimum) { |
27
|
16
|
|
|
|
|
41
|
$context->log_error("The instance value is less than minimum keyword value"); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |