- print to_json($data, {utf8 => 1, allow_nonref => 1, canonical => 1, pretty => 1 });
+ print to_json($data, {utf8 => 1, allow_nonref => 1, canonical => 1, pretty => 1 });
- my $type = $result_schema->{type};
- if ($type eq 'object') {
- die "implement me";
- } elsif ($type eq 'array') {
- my $item_type = $result_schema->{items}->{type};
- if ($item_type eq 'object') {
- die "implement me";
- } elsif ($item_type eq 'array') {
- die "implement me";
- } else {
- foreach my $el (@$data) {
- print "$el\n"
- }
- }
- } else {
- print "$data\n";
- }
+ my $type = $result_schema->{type};
+ if ($type eq 'object') {
+ die "implement me";
+ } elsif ($type eq 'array') {
+ my $item_type = $result_schema->{items}->{type};
+ if ($item_type eq 'object') {
+ die "implement me";
+ } elsif ($item_type eq 'array') {
+ die "implement me";
+ } else {
+ foreach my $el (@$data) {
+ print "$el\n"
+ }
+ }
+ } else {
+ print "$data\n";
+ }
- my $child = $map_path_to_info->(get_api_definition(), $stack, $uri_param);
+ my $api = get_api_definition();
+
+ my $child = scalar(@$stack) ? $map_path_to_info->($api->{children}, $stack, $uri_param) : $api;