get_options: allow no arguments if all are optional

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-09-07 09:59:01 +02:00
parent a24d91ea08
commit 3fe29ce6c9

View 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);
}
}