line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MinProperties; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
21587
|
use strict; |
|
47
|
|
|
|
|
110
|
|
|
47
|
|
|
|
|
1048
|
|
4
|
47
|
|
|
47
|
|
139
|
use warnings; |
|
47
|
|
|
|
|
45
|
|
|
47
|
|
|
|
|
925
|
|
5
|
47
|
|
|
47
|
|
132
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
47
|
|
|
47
|
|
|
|
|
173
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
2432
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
47
|
|
|
47
|
|
|
|
|
8083
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub instance_type() { INSTANCE_TYPE_OBJECT(); } |
10
|
|
|
|
|
|
|
sub keyword() { "minProperties" } |
11
|
|
|
|
|
|
|
sub keyword_priority() { 10; } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub validate { |
14
|
16
|
|
|
16
|
0
|
15
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
16
|
|
|
|
|
30
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
16
|
100
|
|
|
|
41
|
if (scalar keys %$instance < $keyword_value) { |
19
|
6
|
|
|
|
|
23
|
$context->log_error("The instance properties is less than minProperties value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |