line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MaxProperties; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
22131
|
use strict; |
|
47
|
|
|
|
|
57
|
|
|
47
|
|
|
|
|
1098
|
|
4
|
47
|
|
|
47
|
|
145
|
use warnings; |
|
47
|
|
|
|
|
50
|
|
|
47
|
|
|
|
|
951
|
|
5
|
47
|
|
|
47
|
|
160
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
45
|
|
|
47
|
|
|
|
|
269
|
|
6
|
47
|
|
|
47
|
|
2089
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
49
|
|
|
47
|
|
|
|
|
8149
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub instance_type() { INSTANCE_TYPE_OBJECT(); } |
9
|
|
|
|
|
|
|
sub keyword() { "maxProperties" } |
10
|
|
|
|
|
|
|
sub keyword_priority() { 10; } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub validate { |
13
|
16
|
|
|
16
|
0
|
18
|
my ($class, $context, $schema, $instance) = @_; |
14
|
|
|
|
|
|
|
|
15
|
16
|
|
|
|
|
33
|
my $keyword_value = $class->keyword_value($schema); |
16
|
|
|
|
|
|
|
|
17
|
16
|
100
|
|
|
|
47
|
if (scalar keys %$instance > $keyword_value) { |
18
|
4
|
|
|
|
|
11
|
$context->log_error("The instance properties is greater than maxProperties value"); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |