line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::Schema::Generator::Handler::Object; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
45
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
53
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
1781
|
use List::MoreUtils qw(uniq); |
|
2
|
|
|
|
|
23890
|
|
|
2
|
|
|
|
|
14
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub process { |
9
|
1
|
|
|
1
|
0
|
2
|
my ($class, $object_type, $examples, $dispatch) = @_; |
10
|
1
|
|
|
|
|
3
|
my $examples_by_prop = {}; |
11
|
1
|
|
|
|
|
2
|
for my $data (@$examples) { |
12
|
3
|
|
|
|
|
8
|
for my $key (keys %$data) { |
13
|
13
|
|
100
|
|
|
40
|
$examples_by_prop->{$key} //= []; |
14
|
13
|
|
|
|
|
13
|
push @{$examples_by_prop->{$key}}, $data->{$key}; |
|
13
|
|
|
|
|
30
|
|
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
} |
17
|
1
|
|
|
|
|
5
|
my $properties = $object_type->properties; |
18
|
|
|
|
|
|
|
return { |
19
|
|
|
|
|
|
|
type => $object_type->name, |
20
|
|
|
|
|
|
|
properties => { |
21
|
1
|
|
|
|
|
10
|
map { ($_ => $dispatch->($properties->{$_}, $examples_by_prop->{$_})) } keys %$properties, |
|
5
|
|
|
|
|
57
|
|
22
|
|
|
|
|
|
|
}, |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|