Allow to return the original tree with all refs. We use this
with our new pveclient which needs the full api definition.
Keeping refs makes it possible to store the tree more efficiently.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
- my ($tree, $index, $class, $prefix) = @_;
+ my ($tree, $index, $class, $prefix, $raw_dump) = @_;
$prefix = '' if !$prefix;
$prefix = '' if !$prefix;
$path =~ s/\/+$//;
if ($info->{subclass}) {
$path =~ s/\/+$//;
if ($info->{subclass}) {
- api_dump_full($tree, $index, $info->{subclass}, $path);
+ api_dump_full($tree, $index, $info->{subclass}, $path, $raw_dump);
$k eq "path";
my $d = $info->{$k};
$k eq "path";
my $d = $info->{$k};
-
- if ($k eq 'parameters') {
- $data->{$k} = api_clone_schema($d);
- } else {
- $data->{$k} = ref($d) ? clone($d) : $d;
+ if ($raw_dump) {
+ $data->{$k} = $d;
+ } else {
+ if ($k eq 'parameters') {
+ $data->{$k} = api_clone_schema($d);
+ } else {
+ $data->{$k} = ref($d) ? clone($d) : $d;
+ }
}
}
$res->{info}->{$info->{method}} = $data;
}
}
$res->{info}->{$info->{method}} = $data;
- my ($class, $prefix) = @_;
+ my ($class, $prefix, $raw_dump) = @_;
my $tree = [];
my $index = {};
my $tree = [];
my $index = {};
- api_dump_full($tree, $index, $class);
+ api_dump_full($tree, $index, $class, $prefix, $raw_dump);
api_dump_cleanup_tree($tree);
return $tree;
};
api_dump_cleanup_tree($tree);
return $tree;
};