line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::Minimum; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
36332
|
use strict; |
|
47
|
|
|
|
|
105
|
|
|
47
|
|
|
|
|
1306
|
|
4
|
47
|
|
|
47
|
|
258
|
use warnings; |
|
47
|
|
|
|
|
96
|
|
|
47
|
|
|
|
|
1305
|
|
5
|
47
|
|
|
47
|
|
250
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
97
|
|
|
47
|
|
|
|
|
269
|
|
6
|
47
|
|
|
47
|
|
2388
|
use JSON; |
|
47
|
|
|
|
|
143
|
|
|
47
|
|
|
|
|
323
|
|
7
|
|
|
|
|
|
|
|
8
|
47
|
|
|
47
|
|
5694
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
108
|
|
|
47
|
|
|
|
|
13896
|
|
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
|
121
|
my ($class, $context, $schema, $instance) = @_; |
16
|
|
|
|
|
|
|
|
17
|
55
|
|
|
|
|
242
|
my $minimum = $class->keyword_value($schema); |
18
|
55
|
|
66
|
|
|
189
|
my $exclusive_minimum = $class->keyword_value($schema, "exclusiveMinimum") || JSON::false; |
19
|
|
|
|
|
|
|
|
20
|
55
|
100
|
|
|
|
859
|
if ($exclusive_minimum) { |
21
|
11
|
100
|
|
|
|
92
|
if ($instance <= $minimum) { |
22
|
7
|
|
|
|
|
23
|
$context->log_error("The instance value is less than or equals minimum keyword value"); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
else { |
26
|
44
|
100
|
|
|
|
451
|
if ($instance < $minimum) { |
27
|
16
|
|
|
|
|
71
|
$context->log_error("The instance value is less than minimum keyword value"); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |