line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::Minimum; |
2
|
|
|
|
|
|
|
|
3
|
44
|
|
|
44
|
|
30663
|
use strict; |
|
44
|
|
|
|
|
84
|
|
|
44
|
|
|
|
|
1099
|
|
4
|
44
|
|
|
44
|
|
212
|
use warnings; |
|
44
|
|
|
|
|
86
|
|
|
44
|
|
|
|
|
1126
|
|
5
|
44
|
|
|
44
|
|
203
|
use parent qw(JSV::Keyword); |
|
44
|
|
|
|
|
87
|
|
|
44
|
|
|
|
|
212
|
|
6
|
44
|
|
|
44
|
|
1940
|
use JSON; |
|
44
|
|
|
|
|
86
|
|
|
44
|
|
|
|
|
259
|
|
7
|
|
|
|
|
|
|
|
8
|
44
|
|
|
44
|
|
4509
|
use JSV::Keyword qw(:constants); |
|
44
|
|
|
|
|
82
|
|
|
44
|
|
|
|
|
11188
|
|
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
|
99
|
my ($class, $context, $schema, $instance) = @_; |
16
|
|
|
|
|
|
|
|
17
|
55
|
|
|
|
|
221
|
my $minimum = $class->keyword_value($schema); |
18
|
55
|
|
66
|
|
|
168
|
my $exclusive_minimum = $class->keyword_value($schema, "exclusiveMinimum") || JSON::false; |
19
|
|
|
|
|
|
|
|
20
|
55
|
100
|
|
|
|
801
|
if ($exclusive_minimum) { |
21
|
11
|
100
|
|
|
|
77
|
if ($instance <= $minimum) { |
22
|
7
|
|
|
|
|
21
|
$context->log_error("The instance value is less than or equals minimum keyword value"); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
else { |
26
|
44
|
100
|
|
|
|
420
|
if ($instance < $minimum) { |
27
|
16
|
|
|
|
|
68
|
$context->log_error("The instance value is less than minimum keyword value"); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |