line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MaxProperties; |
2
|
|
|
|
|
|
|
|
3
|
44
|
|
|
44
|
|
30006
|
use strict; |
|
44
|
|
|
|
|
86
|
|
|
44
|
|
|
|
|
1106
|
|
4
|
44
|
|
|
44
|
|
199
|
use warnings; |
|
44
|
|
|
|
|
74
|
|
|
44
|
|
|
|
|
1088
|
|
5
|
44
|
|
|
44
|
|
197
|
use parent qw(JSV::Keyword); |
|
44
|
|
|
|
|
70
|
|
|
44
|
|
|
|
|
225
|
|
6
|
44
|
|
|
44
|
|
2196
|
use JSV::Keyword qw(:constants); |
|
44
|
|
|
|
|
100
|
|
|
44
|
|
|
|
|
9737
|
|
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
|
34
|
my ($class, $context, $schema, $instance) = @_; |
14
|
|
|
|
|
|
|
|
15
|
16
|
|
|
|
|
63
|
my $keyword_value = $class->keyword_value($schema); |
16
|
|
|
|
|
|
|
|
17
|
16
|
100
|
|
|
|
67
|
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; |