line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::JsonAPI::Autodoc::Response; |
2
|
14
|
|
|
14
|
|
54
|
use strict; |
|
14
|
|
|
|
|
18
|
|
|
14
|
|
|
|
|
441
|
|
3
|
14
|
|
|
14
|
|
59
|
use warnings; |
|
14
|
|
|
|
|
15
|
|
|
14
|
|
|
|
|
293
|
|
4
|
14
|
|
|
14
|
|
49
|
use utf8; |
|
14
|
|
|
|
|
14
|
|
|
14
|
|
|
|
|
62
|
|
5
|
14
|
|
|
14
|
|
204
|
use JSON; |
|
14
|
|
|
|
|
14
|
|
|
14
|
|
|
|
|
50
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
15
|
|
|
15
|
0
|
28
|
my ($class) = @_; |
9
|
|
|
|
|
|
|
|
10
|
15
|
|
|
|
|
84
|
bless { |
11
|
|
|
|
|
|
|
}, $class; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub parse { |
15
|
15
|
|
|
15
|
0
|
29
|
my ($self, $res) = @_; |
16
|
|
|
|
|
|
|
|
17
|
15
|
|
|
|
|
73
|
my $body = $res->content; |
18
|
15
|
|
|
|
|
175
|
my $content_type = $res->content_type; |
19
|
15
|
100
|
|
|
|
384
|
if ($content_type =~ m!^application/json!) { |
20
|
13
|
|
|
|
|
84
|
$body = to_json(from_json($res->decoded_content), { pretty => 1, canonical => 1 }); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
return { |
24
|
15
|
|
|
|
|
1998
|
body => $body, |
25
|
|
|
|
|
|
|
content_type => $content_type, |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |