mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-15 10:03:40 +00:00
JSONSchema: named formats in parse_property_string
While our code currently passes the format hashes directly, some code gets them via the format property of a configuration description which verifies successfully via check_format() for named property string formats, so this should be allowed.
This commit is contained in:
parent
a9da67124d
commit
7c1617b01d
@ -506,6 +506,17 @@ sub parse_property_string {
|
|||||||
# In property strings we default to not allowing additional properties
|
# In property strings we default to not allowing additional properties
|
||||||
$additional_properties = 0 if !defined($additional_properties);
|
$additional_properties = 0 if !defined($additional_properties);
|
||||||
|
|
||||||
|
# Support named formats here, too:
|
||||||
|
if (!ref($format)) {
|
||||||
|
if (my $desc = $format_list->{$format}) {
|
||||||
|
$format = $desc;
|
||||||
|
} else {
|
||||||
|
die "unknown format: $format\n";
|
||||||
|
}
|
||||||
|
} elsif (ref($format) ne 'HASH') {
|
||||||
|
die "unexpected format value of type ".ref($format)."\n";
|
||||||
|
}
|
||||||
|
|
||||||
my $default_key;
|
my $default_key;
|
||||||
|
|
||||||
my $res = {};
|
my $res = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user