]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/JSONSchema.pm
get_options: allow no arguments if all are optional
[pve-common.git] / src / PVE / JSONSchema.pm
index 2ceb1bd7aaac47019d1929a98706d487ab86ce46..e8d7395a858619a13668d5a570671f57198803a7 100644 (file)
@@ -1644,7 +1644,7 @@ sub get_options {
            foreach my $arg_name (@$arg_param) {
                if ($arg_name eq 'extra-args') {
                    $opts->{'extra-args'} = [];
-               } else {
+               } elsif (!$schema->{properties}->{$arg_name}->{optional}) {
                    raise("not enough arguments\n", code => HTTP_BAD_REQUEST);
                }
            }