From 3fe29ce6c9f7c94837fefba44f180feab7f93efb Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 7 Sep 2020 09:59:01 +0200 Subject: [PATCH] get_options: allow no arguments if all are optional Signed-off-by: Thomas Lamprecht --- src/PVE/JSONSchema.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } } -- 2.39.2