From: Thomas Lamprecht Date: Mon, 7 Sep 2020 07:59:01 +0000 (+0200) Subject: get_options: allow no arguments if all are optional X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=3fe29ce6c9f7c94837fefba44f180feab7f93efb get_options: allow no arguments if all are optional Signed-off-by: Thomas Lamprecht --- diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm index 2ceb1bd..e8d7395 100644 --- a/src/PVE/JSONSchema.pm +++ b/src/PVE/JSONSchema.pm @@ -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); } }