X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FJSONSchema.pm;h=021e4e0784413037b410e551d4f9d0c82b120c77;hp=b53736e4c63b0ec9975e2b385defcb71229e8597;hb=05185ea25a0fabbd5a7071aa13c9b61de8f73861;hpb=534d42709838dce93d7e4258cf84dcb816125c40 diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm index b53736e..021e4e0 100644 --- a/src/PVE/JSONSchema.pm +++ b/src/PVE/JSONSchema.pm @@ -1676,12 +1676,14 @@ sub schema_get_type_text { } elsif ($phash->{pattern}) { return $phash->{pattern}; } elsif ($type eq 'integer' || $type eq 'number') { + # NOTE: always access values as number (avoid converion to string) 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})) { - return "$type ($phash->{minimum} - N)"; + return "$type (" . ($phash->{minimum} + 0) . "- N)"; } elsif (defined($phash->{maximum})) { - return "$type (-N - $phash->{maximum})"; + return "$type (-N - " . ($phash->{maximum} + 0) . ")"; } } elsif ($type eq 'string') { if (my $format = $phash->{format}) {