This works with CODE refs like 'completion' helpers.
use PVE::PodParser;
use HTTP::Status qw(:constants :is status_message);
use Text::Wrap;
use PVE::PodParser;
use HTTP::Status qw(:constants :is status_message);
use Text::Wrap;
-use Storable qw(dclone);
my $method_registry = {};
my $method_by_name = {};
my $method_registry = {};
my $method_by_name = {};
foreach my $k (keys %$schema) {
my $d = $schema->{$k};
if ($k ne 'properties') {
foreach my $k (keys %$schema) {
my $d = $schema->{$k};
if ($k ne 'properties') {
- $res->{$k} = ref($d) ? dclone($d) : $d;
+ $res->{$k} = ref($d) ? clone($d) : $d;
next;
}
# convert indexed parameters like -net\d+ to -net[n]
next;
}
# convert indexed parameters like -net\d+ to -net[n]
- $res->{$k}->{$p} = ref($pd) ? dclone($pd) : $pd;
+ $res->{$k}->{$p} = ref($pd) ? clone($pd) : $pd;
$data->{$k} = api_clone_schema($d);
} else {
$data->{$k} = api_clone_schema($d);
} else {
- $data->{$k} = ref($d) ? dclone($d) : $d;
+ $data->{$k} = ref($d) ? clone($d) : $d;
}
}
$res->{info}->{$info->{method}} = $data;
}
}
$res->{info}->{$info->{method}} = $data;