X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FCLIFormatter.pm;h=84dbed1e6e2af6fbaf63c2e7d3631247f94bd664;hp=e886db5797ccdb06b8fb5a81d77cefb5b5337e7d;hb=c0b8717c443436d724f4e0be9cfce725d8123df0;hpb=b610385849cd365b5bc8211057ed8cd456ebc3d8 diff --git a/src/PVE/CLIFormatter.pm b/src/PVE/CLIFormatter.pm index e886db5..84dbed1 100644 --- a/src/PVE/CLIFormatter.pm +++ b/src/PVE/CLIFormatter.pm @@ -413,6 +413,7 @@ sub print_api_result { if ($result_schema && defined($result_schema->{type})) { return if $result_schema->{type} eq 'null'; + return if $result_schema->{optional} && !defined($data); } else { my $type = $guess_type->($data); $result_schema = { type => $type };