line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MaxProperties; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
36986
|
use strict; |
|
47
|
|
|
|
|
95
|
|
|
47
|
|
|
|
|
1335
|
|
4
|
47
|
|
|
47
|
|
247
|
use warnings; |
|
47
|
|
|
|
|
117
|
|
|
47
|
|
|
|
|
1343
|
|
5
|
47
|
|
|
47
|
|
242
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
96
|
|
|
47
|
|
|
|
|
292
|
|
6
|
47
|
|
|
47
|
|
2536
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
94
|
|
|
47
|
|
|
|
|
11830
|
|
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
|
36
|
my ($class, $context, $schema, $instance) = @_; |
14
|
|
|
|
|
|
|
|
15
|
16
|
|
|
|
|
113
|
my $keyword_value = $class->keyword_value($schema); |
16
|
|
|
|
|
|
|
|
17
|
16
|
100
|
|
|
|
85
|
if (scalar keys %$instance > $keyword_value) { |
18
|
4
|
|
|
|
|
18
|
$context->log_error("The instance properties is greater than maxProperties value"); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |