]>
git.proxmox.com Git - pmg-docs.git/blob - extractapi.pl
283d8a07a495ea90d519a65b95b8c7f0fac58d04
17 if ($class eq 'ARRAY') {
19 foreach my $el (@$h) {
20 push @$res, cleanup_tree
($el);
23 } elsif ($class eq 'HASH') {
25 foreach my $k (keys %$h) {
26 if (my $class = ref($h->{$k})) {
27 if ($class eq 'CODE') {
28 next if $k eq 'completion';
30 $res->{$k} = cleanup_tree
($h->{$k});
32 $res->{$k} = $h->{$k};
36 } elsif ($class eq 'Regexp') {
37 return "$h"; # return string representation
39 die "unknown class '$class'\n";
43 my $tree = cleanup_tree
(PVE
::RESTHandler
::api_dump
('PMG::API2'));
45 print "var pmgapi = " . to_json
($tree, {pretty
=> 1, canonical
=> 1}) . ";\n\n";