mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-09 05:15:49 +00:00
JSONSchema::check_object_warn
A version of check_object that warns and returns true or false.
This commit is contained in:
parent
d5d10f8580
commit
86425a09da
@ -563,6 +563,19 @@ sub check_object {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub check_object_warn {
|
||||||
|
my ($path, $schema, $value, $additional_properties) = @_;
|
||||||
|
my $errors = {};
|
||||||
|
check_object($path, $schema, $value, $additional_properties, $errors);
|
||||||
|
if (scalar(%$errors)) {
|
||||||
|
foreach my $k (keys %$errors) {
|
||||||
|
warn "parse error: $k: $errors->{$k}\n";
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
sub check_prop {
|
sub check_prop {
|
||||||
my ($value, $schema, $path, $errors) = @_;
|
my ($value, $schema, $path, $errors) = @_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user