line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MinProperties; |
2
|
|
|
|
|
|
|
|
3
|
44
|
|
|
44
|
|
31645
|
use strict; |
|
44
|
|
|
|
|
89
|
|
|
44
|
|
|
|
|
1167
|
|
4
|
44
|
|
|
44
|
|
200
|
use warnings; |
|
44
|
|
|
|
|
71
|
|
|
44
|
|
|
|
|
1121
|
|
5
|
44
|
|
|
44
|
|
195
|
use parent qw(JSV::Keyword); |
|
44
|
|
|
|
|
67
|
|
|
44
|
|
|
|
|
222
|
|
6
|
|
|
|
|
|
|
|
7
|
44
|
|
|
44
|
|
2586
|
use JSV::Keyword qw(:constants); |
|
44
|
|
|
|
|
110
|
|
|
44
|
|
|
|
|
10278
|
|
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
|
34
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
16
|
|
|
|
|
53
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
16
|
100
|
|
|
|
67
|
if (scalar keys %$instance < $keyword_value) { |
19
|
6
|
|
|
|
|
35
|
$context->log_error("The instance properties is less than minProperties value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |