]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/JSONSchema.pm
CpuSet: read $MAX_CPUID from /proc/cpuinfo
[pve-common.git] / src / PVE / JSONSchema.pm
index b53736e4c63b0ec9975e2b385defcb71229e8597..debbbb5904004936e4553217fecc3f363db14a05 100644 (file)
@@ -720,7 +720,7 @@ sub check_object {
                    check_prop($value, $requires, $path, $errors);
                } elsif (!defined($value->{$requires})) {
                    add_error($errors, $path ? "$path.$requires" : $requires, 
-                             "missing property - '$newpath' requiers this property");
+                             "missing property - '$newpath' requires this property");
                }
            }
 
@@ -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}) {