we sometimes define
result => {}
on an api call, so check that result->{type} is defined
and guess the type if not
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
my $format = $options->{'output-format'} // 'text';
my $format = $options->{'output-format'} // 'text';
+ if ($result_schema && defined($result_schema->{type})) {
return if $result_schema->{type} eq 'null';
} else {
my $type = $guess_type->($data);
return if $result_schema->{type} eq 'null';
} else {
my $type = $guess_type->($data);