line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::JsonAPI::Autodoc::Response; |
2
|
15
|
|
|
15
|
|
65
|
use strict; |
|
15
|
|
|
|
|
17
|
|
|
15
|
|
|
|
|
520
|
|
3
|
15
|
|
|
15
|
|
65
|
use warnings; |
|
15
|
|
|
|
|
17
|
|
|
15
|
|
|
|
|
360
|
|
4
|
15
|
|
|
15
|
|
58
|
use utf8; |
|
15
|
|
|
|
|
17
|
|
|
15
|
|
|
|
|
82
|
|
5
|
15
|
|
|
15
|
|
257
|
use JSON; |
|
15
|
|
|
|
|
19
|
|
|
15
|
|
|
|
|
76
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
17
|
|
|
17
|
0
|
36
|
my ($class) = @_; |
9
|
|
|
|
|
|
|
|
10
|
17
|
|
|
|
|
93
|
bless { |
11
|
|
|
|
|
|
|
}, $class; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub parse { |
15
|
17
|
|
|
17
|
0
|
31
|
my ($self, $res) = @_; |
16
|
|
|
|
|
|
|
|
17
|
17
|
|
|
|
|
69
|
my $body = $res->content; |
18
|
17
|
|
|
|
|
202
|
my $content_type = $res->content_type; |
19
|
17
|
100
|
|
|
|
419
|
if ($content_type =~ m!^application/json!) { |
20
|
15
|
|
|
|
|
101
|
$body = to_json(from_json($res->decoded_content, { utf8 => 1 }), { pretty => 1, canonical => 1 }); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
return { |
24
|
17
|
|
|
|
|
2492
|
body => $body, |
25
|
|
|
|
|
|
|
content_type => $content_type, |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |