line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::Not; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
22206
|
use strict; |
|
47
|
|
|
|
|
55
|
|
|
47
|
|
|
|
|
1129
|
|
4
|
47
|
|
|
47
|
|
140
|
use warnings; |
|
47
|
|
|
|
|
48
|
|
|
47
|
|
|
|
|
919
|
|
5
|
47
|
|
|
47
|
|
132
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
48
|
|
|
47
|
|
|
|
|
166
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
1941
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
48
|
|
|
47
|
|
|
|
|
10212
|
|
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
|
8
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
6
|
|
|
|
|
18
|
my $not_schema = $class->keyword_value($schema); |
17
|
6
|
|
|
|
|
4
|
my $is_valid = 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
{ |
20
|
6
|
|
|
|
|
7
|
local $context->{current_schema_pointer} = $context->{current_schema_pointer} . "/" . $class->keyword; |
|
6
|
|
|
|
|
21
|
|
21
|
6
|
|
|
|
|
10
|
local $context->{errors} = []; |
22
|
6
|
|
|
|
|
13
|
$context->validate($not_schema, $instance); |
23
|
6
|
100
|
|
|
|
7
|
$is_valid = 1 if scalar @{ $context->{errors} } == 0; |
|
6
|
|
|
|
|
18
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
6
|
100
|
|
|
|
18
|
if ($is_valid) { |
27
|
3
|
|
|
|
|
6
|
$context->log_error("The instance is matched to schema of not keyword value"); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |