mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-15 20:24:11 +00:00
get_options: allow no arguments if all are optional
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
a24d91ea08
commit
3fe29ce6c9
@ -1644,7 +1644,7 @@ sub get_options {
|
|||||||
foreach my $arg_name (@$arg_param) {
|
foreach my $arg_name (@$arg_param) {
|
||||||
if ($arg_name eq 'extra-args') {
|
if ($arg_name eq 'extra-args') {
|
||||||
$opts->{'extra-args'} = [];
|
$opts->{'extra-args'} = [];
|
||||||
} else {
|
} elsif (!$schema->{properties}->{$arg_name}->{optional}) {
|
||||||
raise("not enough arguments\n", code => HTTP_BAD_REQUEST);
|
raise("not enough arguments\n", code => HTTP_BAD_REQUEST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user