summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b610385)
If the return schema says that it's optionally returns something then
we want to allow returning nothing, i.e., undef
Co-developed-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
if ($result_schema && defined($result_schema->{type})) {
return if $result_schema->{type} eq 'null';
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 };
} else {
my $type = $guess_type->($data);
$result_schema = { type => $type };