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
|
blame
|
history
diff --git
a/src/PVE/JSONSchema.pm
b/src/PVE/JSONSchema.pm
index f36ee427f66f8a4dc1509b5a621395965158e5f8..45ce5ba58c3ad5720bdf727d4615ac2d4b8e34d7 100644
(file)
--- a/
src/PVE/JSONSchema.pm
+++ b/
src/PVE/JSONSchema.pm
@@
-1317,11
+1317,11
@@
sub generate_typetext {
&$add($key);
$pre = ', ';
}
- $pre = ' [,' if $pre;
+ $pre = $pre ? ' [,' : '[';
+ $post = ']';
foreach my $key (@optional) {
&$add($key);
$pre = ' [,';
- $post = ']';
}
return $typetext;
}