line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::Not; |
2
|
|
|
|
|
|
|
|
3
|
44
|
|
|
44
|
|
30321
|
use strict; |
|
44
|
|
|
|
|
84
|
|
|
44
|
|
|
|
|
1117
|
|
4
|
44
|
|
|
44
|
|
196
|
use warnings; |
|
44
|
|
|
|
|
81
|
|
|
44
|
|
|
|
|
1067
|
|
5
|
44
|
|
|
44
|
|
196
|
use parent qw(JSV::Keyword); |
|
44
|
|
|
|
|
74
|
|
|
44
|
|
|
|
|
229
|
|
6
|
|
|
|
|
|
|
|
7
|
44
|
|
|
44
|
|
2193
|
use JSV::Keyword qw(:constants); |
|
44
|
|
|
|
|
72
|
|
|
44
|
|
|
|
|
12055
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub instance_type() { INSTANCE_TYPE_ANY(); } |
10
|
|
|
|
|
|
|
sub keyword() { "not" } |
11
|
|
|
|
|
|
|
sub keyword_priority() { 10; } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub validate { |
14
|
6
|
|
|
6
|
0
|
12
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
6
|
|
|
|
|
39
|
my $not_schema = $class->keyword_value($schema); |
17
|
6
|
|
|
|
|
11
|
my $is_valid = 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
{ |
20
|
6
|
|
|
|
|
6
|
local $context->{current_schema_pointer} = $context->{current_schema_pointer} . "/" . $class->keyword; |
|
6
|
|
|
|
|
24
|
|
21
|
6
|
|
|
|
|
12
|
local $context->{errors} = []; |
22
|
6
|
|
|
|
|
14
|
$context->validate($not_schema, $instance); |
23
|
6
|
100
|
|
|
|
7
|
$is_valid = 1 if scalar @{ $context->{errors} } == 0; |
|
6
|
|
|
|
|
25
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
6
|
100
|
|
|
|
20
|
if ($is_valid) { |
27
|
3
|
|
|
|
|
9
|
$context->log_error("The instance is matched to schema of not keyword value"); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |