| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
45
|
|
|
45
|
|
389
|
use strict; |
|
|
45
|
|
|
|
|
113
|
|
|
|
45
|
|
|
|
|
1910
|
|
|
2
|
45
|
|
|
45
|
|
233
|
use warnings; |
|
|
45
|
|
|
|
|
90
|
|
|
|
45
|
|
|
|
|
3655
|
|
|
3
|
|
|
|
|
|
|
package JSON::Schema::Modern::Error; |
|
4
|
|
|
|
|
|
|
# vim: set ts=8 sts=2 sw=2 tw=100 et : |
|
5
|
|
|
|
|
|
|
# ABSTRACT: Contains a single error from a JSON Schema evaluation |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.634'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
45
|
|
|
45
|
|
831
|
use 5.020; |
|
|
45
|
|
|
|
|
180
|
|
|
10
|
45
|
|
|
45
|
|
273
|
use Moo; |
|
|
45
|
|
|
|
|
82
|
|
|
|
45
|
|
|
|
|
428
|
|
|
11
|
|
|
|
|
|
|
with 'JSON::Schema::Modern::ResultNode'; |
|
12
|
45
|
|
|
45
|
|
21474
|
use strictures 2; |
|
|
45
|
|
|
|
|
431
|
|
|
|
45
|
|
|
|
|
2113
|
|
|
13
|
45
|
|
|
45
|
|
24243
|
use stable 0.031 'postderef'; |
|
|
45
|
|
|
|
|
964
|
|
|
|
45
|
|
|
|
|
451
|
|
|
14
|
45
|
|
|
45
|
|
10894
|
use experimental 'signatures'; |
|
|
45
|
|
|
|
|
160
|
|
|
|
45
|
|
|
|
|
222
|
|
|
15
|
45
|
|
|
45
|
|
3281
|
no autovivification warn => qw(fetch store exists delete); |
|
|
45
|
|
|
|
|
86
|
|
|
|
45
|
|
|
|
|
461
|
|
|
16
|
45
|
|
|
45
|
|
4183
|
use if "$]" >= 5.022, experimental => 're_strict'; |
|
|
45
|
|
|
|
|
102
|
|
|
|
45
|
|
|
|
|
1422
|
|
|
17
|
45
|
|
|
45
|
|
4003
|
no if "$]" >= 5.031009, feature => 'indirect'; |
|
|
45
|
|
|
|
|
99
|
|
|
|
45
|
|
|
|
|
3991
|
|
|
18
|
45
|
|
|
45
|
|
284
|
no if "$]" >= 5.033001, feature => 'multidimensional'; |
|
|
45
|
|
|
|
|
96
|
|
|
|
45
|
|
|
|
|
3163
|
|
|
19
|
45
|
|
|
45
|
|
272
|
no if "$]" >= 5.033006, feature => 'bareword_filehandles'; |
|
|
45
|
|
|
|
|
93
|
|
|
|
45
|
|
|
|
|
3475
|
|
|
20
|
45
|
|
|
45
|
|
264
|
no if "$]" >= 5.041009, feature => 'smartmatch'; |
|
|
45
|
|
|
|
|
89
|
|
|
|
45
|
|
|
|
|
2745
|
|
|
21
|
45
|
|
|
45
|
|
272
|
no feature 'switch'; |
|
|
45
|
|
|
|
|
116
|
|
|
|
45
|
|
|
|
|
1613
|
|
|
22
|
45
|
|
|
45
|
|
895
|
use MooX::TypeTiny; |
|
|
45
|
|
|
|
|
431
|
|
|
|
45
|
|
|
|
|
583
|
|
|
23
|
45
|
|
|
45
|
|
44284
|
use Types::Standard qw(Str Bool Enum Tuple); |
|
|
45
|
|
|
|
|
101
|
|
|
|
45
|
|
|
|
|
427
|
|
|
24
|
45
|
|
|
45
|
|
125539
|
use Types::Common::Numeric qw(PositiveInt); |
|
|
45
|
|
|
|
|
1593047
|
|
|
|
45
|
|
|
|
|
621
|
|
|
25
|
45
|
|
|
45
|
|
50552
|
use builtin::compat 'refaddr'; |
|
|
45
|
|
|
|
|
208
|
|
|
|
45
|
|
|
|
|
554
|
|
|
26
|
45
|
|
|
45
|
|
35705
|
use Mojo::Message::Response; |
|
|
45
|
|
|
|
|
3300052
|
|
|
|
45
|
|
|
|
|
695
|
|
|
27
|
45
|
|
|
45
|
|
3122
|
use Carp 'croak'; |
|
|
45
|
|
|
|
|
118
|
|
|
|
45
|
|
|
|
|
3345
|
|
|
28
|
45
|
|
|
45
|
|
338
|
use namespace::clean; |
|
|
45
|
|
|
|
|
108
|
|
|
|
45
|
|
|
|
|
540
|
|
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
use overload |
|
31
|
0
|
|
|
0
|
|
0
|
'""' => sub { $_[0]->stringify }, |
|
32
|
45
|
|
|
45
|
|
23204
|
fallback => 1; |
|
|
45
|
|
|
|
|
117
|
|
|
|
45
|
|
|
|
|
494
|
|
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has error => ( |
|
35
|
|
|
|
|
|
|
is => 'ro', |
|
36
|
|
|
|
|
|
|
isa => Str, |
|
37
|
|
|
|
|
|
|
required => 1, |
|
38
|
|
|
|
|
|
|
); |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
has exception => ( |
|
41
|
|
|
|
|
|
|
is => 'ro', |
|
42
|
|
|
|
|
|
|
isa => Bool, |
|
43
|
|
|
|
|
|
|
); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
has mode => ( |
|
46
|
|
|
|
|
|
|
is => 'ro', |
|
47
|
|
|
|
|
|
|
isa => Enum[qw(traverse evaluate)], |
|
48
|
|
|
|
|
|
|
required => 1, |
|
49
|
|
|
|
|
|
|
); |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
has recommended_response => ( |
|
52
|
|
|
|
|
|
|
is => 'ro', |
|
53
|
|
|
|
|
|
|
isa => Tuple[PositiveInt, Str], |
|
54
|
|
|
|
|
|
|
); |
|
55
|
|
|
|
|
|
|
|
|
56
|
7
|
|
|
7
|
0
|
72
|
sub stringify ($self) { |
|
|
7
|
|
|
|
|
14
|
|
|
|
7
|
|
|
|
|
14
|
|
|
57
|
7
|
100
|
|
|
|
151
|
$self->mode eq 'traverse' |
|
58
|
|
|
|
|
|
|
? '\''.$self->keyword_location.'\': '.$self->error |
|
59
|
|
|
|
|
|
|
: '\''.$self->instance_location.'\': '.$self->error; |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
2
|
|
|
2
|
1
|
77
|
sub clone ($self, %overrides) { |
|
|
2
|
|
|
|
|
8
|
|
|
|
2
|
|
|
|
|
12
|
|
|
|
2
|
|
|
|
|
5
|
|
|
63
|
|
|
|
|
|
|
$self->new( |
|
64
|
|
|
|
|
|
|
$self->%{qw(instance_location keyword_location keyword depth)}, |
|
65
|
|
|
|
|
|
|
(map +(exists $self->{$_} ? $self->%{$_} : ()), qw(absolute_keyword_location _uri recommended_response)), |
|
66
|
2
|
100
|
|
|
|
127
|
$self->%{qw(error exception mode)}, |
|
67
|
|
|
|
|
|
|
%overrides, |
|
68
|
|
|
|
|
|
|
); |
|
69
|
|
|
|
|
|
|
} |
|
70
|
|
|
|
|
|
|
|
|
71
|
18546
|
|
|
18546
|
|
48815
|
sub __thing { 'error' } |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
around BUILDARGS => sub ($orig, $class, @args) { |
|
74
|
|
|
|
|
|
|
my $args = $class->$orig(@args); |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
$args->{recommended_response}[1] = |
|
77
|
|
|
|
|
|
|
Mojo::Message::Response->default_message($args->{recommended_response}[0]) // 'Unknown Error' |
|
78
|
|
|
|
|
|
|
if $args->{recommended_response} and $args->{recommended_response}->@* == 1; |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
croak 'instance_location must be defined when mode=evaluate' |
|
81
|
|
|
|
|
|
|
if not defined $args->{instance_location} and ($args->{mode}//'') eq 'evaluate'; |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
return $args; |
|
84
|
|
|
|
|
|
|
}; |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
1; |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
__END__ |