]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/RESTHandler.pm
fix doc generator (do not convert efidisk0 to efidisk[N])
[pve-common.git] / src / PVE / RESTHandler.pm
index fc220a6018481d48bc2ab75b8aa39eb3728964b2..5e46dc3fb85097bb5c24193055a2aecf6aedf219 100644 (file)
@@ -34,7 +34,7 @@ sub api_clone_schema {
            my $pd = $d->{$p};
            if ($p =~ m/^([a-z]+)(\d+)$/) {
                my ($name, $idx) = ($1, $2);
-               if ($idx == 0) {
+               if ($idx == 0 && defined($d->{"${name}1"})) {
                    $p = "${name}[n]";
                } elsif (defined($d->{"${name}0"})) {
                    next; # only handle once for -xx0, but only if -xx0 exists
@@ -591,7 +591,7 @@ sub usage_str {
        if ($k =~ m/^([a-z]+)(\d+)$/) {
            my ($name, $idx) = ($1, $2);
            next if $idx_param->{$name};
-           if ($idx == 0) {
+           if ($idx == 0 && defined($prop->{"${name}1"})) {
                $idx_param->{$name} = 1;
                $base = "${name}[n]";
            }
@@ -656,7 +656,7 @@ sub dump_properties {
        if ($k =~ m/^([a-z]+)(\d+)$/) {
            my ($name, $idx) = ($1, $2);
            next if $idx_param->{$name};
-           if ($idx == 0) {
+           if ($idx == 0 && defined($prop->{"${name}1"})) {
                $idx_param->{$name} = 1;
                $base = "${name}[n]";
            }