mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-27 22:32:03 +00:00
schema_get_type_text: always access values as number
Else PVE::RESTHandler::api_dump prints values as strings.
This commit is contained in:
parent
534d427098
commit
05185ea25a
@ -1676,12 +1676,14 @@ sub schema_get_type_text {
|
|||||||
} elsif ($phash->{pattern}) {
|
} elsif ($phash->{pattern}) {
|
||||||
return $phash->{pattern};
|
return $phash->{pattern};
|
||||||
} elsif ($type eq 'integer' || $type eq 'number') {
|
} elsif ($type eq 'integer' || $type eq 'number') {
|
||||||
|
# NOTE: always access values as number (avoid converion to string)
|
||||||
if (defined($phash->{minimum}) && defined($phash->{maximum})) {
|
if (defined($phash->{minimum}) && defined($phash->{maximum})) {
|
||||||
return "$type ($phash->{minimum} - $phash->{maximum})";
|
return "$type (" . ($phash->{minimum} + 0) . "-" .
|
||||||
|
($phash->{maximum} + 0) . ")";
|
||||||
} elsif (defined($phash->{minimum})) {
|
} elsif (defined($phash->{minimum})) {
|
||||||
return "$type ($phash->{minimum} - N)";
|
return "$type (" . ($phash->{minimum} + 0) . "- N)";
|
||||||
} elsif (defined($phash->{maximum})) {
|
} elsif (defined($phash->{maximum})) {
|
||||||
return "$type (-N - $phash->{maximum})";
|
return "$type (-N - " . ($phash->{maximum} + 0) . ")";
|
||||||
}
|
}
|
||||||
} elsif ($type eq 'string') {
|
} elsif ($type eq 'string') {
|
||||||
if (my $format = $phash->{format}) {
|
if (my $format = $phash->{format}) {
|
||||||
|
Loading…
Reference in New Issue
Block a user