[pve-devel] [PATCH pve-common] print_property_string: skip keys early

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Nov 25 15:18:19 CET 2015


Keys in the skip-list don't need to be valid schema keys.
This was overly strict before which makes it harder to
include temporary internal keys in a such an object.
---
 src/PVE/JSONSchema.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm
index e83d8de..a9a5400 100644
--- a/src/PVE/JSONSchema.pm
+++ b/src/PVE/JSONSchema.pm
@@ -582,9 +582,9 @@ sub print_property_string {
     }
 
     foreach my $key (sort keys %$data) {
-	die "invalid key: $key" if !$allowed{$key};
 	delete $required{$key};
 	next if $skipped{$key};
+	die "invalid key: $key" if !$allowed{$key};
 
 	my $typeformat = $format->{$key}->{format};
 	my $value = $data->{$key};
-- 
2.1.4





More information about the pve-devel mailing list