projects
/
pve-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8c2d3ca
)
generate_typetext: better handling of only-optional cases
author
Wolfgang Bumiller
<w.bumiller@proxmox.com>
Tue, 22 Sep 2015 11:45:40 +0000
(13:45 +0200)
committer
Dietmar Maurer
<dietmar@proxmox.com>
Wed, 23 Sep 2015 06:01:44 +0000
(08:01 +0200)
src/PVE/JSONSchema.pm
patch
|
blob
|
history
diff --git
a/src/PVE/JSONSchema.pm
b/src/PVE/JSONSchema.pm
index
f36ee42
..
45ce5ba
100644
(file)
--- a/
src/PVE/JSONSchema.pm
+++ b/
src/PVE/JSONSchema.pm
@@
-1317,11
+1317,11
@@
sub generate_typetext {
&$add($key);
$pre = ', ';
}
&$add($key);
$pre = ', ';
}
- $pre = ' [,' if $pre;
+ $pre = $pre ? ' [,' : '[';
+ $post = ']';
foreach my $key (@optional) {
&$add($key);
$pre = ' [,';
foreach my $key (@optional) {
&$add($key);
$pre = ' [,';
- $post = ']';
}
return $typetext;
}
}
return $typetext;
}