line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::Not; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
36239
|
use strict; |
|
47
|
|
|
|
|
91
|
|
|
47
|
|
|
|
|
1248
|
|
4
|
47
|
|
|
47
|
|
245
|
use warnings; |
|
47
|
|
|
|
|
90
|
|
|
47
|
|
|
|
|
1304
|
|
5
|
47
|
|
|
47
|
|
254
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
91
|
|
|
47
|
|
|
|
|
281
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
2557
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
92
|
|
|
47
|
|
|
|
|
14873
|
|
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
|
15
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
6
|
|
|
|
|
27
|
my $not_schema = $class->keyword_value($schema); |
17
|
6
|
|
|
|
|
10
|
my $is_valid = 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
{ |
20
|
6
|
|
|
|
|
11
|
local $context->{current_schema_pointer} = $context->{current_schema_pointer} . "/" . $class->keyword; |
|
6
|
|
|
|
|
31
|
|
21
|
6
|
|
|
|
|
17
|
local $context->{errors} = []; |
22
|
6
|
|
|
|
|
48
|
$context->validate($not_schema, $instance); |
23
|
6
|
100
|
|
|
|
10
|
$is_valid = 1 if scalar @{ $context->{errors} } == 0; |
|
6
|
|
|
|
|
28
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
6
|
100
|
|
|
|
25
|
if ($is_valid) { |
27
|
3
|
|
|
|
|
12
|
$context->log_error("The instance is matched to schema of not keyword value"); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |