- check_prop($value->{$k}, $schema->{$k}, $path ? "$path.$k" : $k, $errors);
+ if (defined(my $group = $schema->{$k}->{group})) {
+ # When a group is aliased then the key/value pair will match the
+ # schema, but if it's not then the group key contains the key-name
+ # which will not match the group key's defined schema and we have
+ # to match it against that...
+ if (!defined($schema->{$group}->{alias})) {
+ $groups{$group} = 1;
+ }
+ }
+ }
+ foreach my $k (keys %$schema) {
+ my $orig_key = $k;
+ my $v;
+ if ($groups{$k}) {
+ if (defined($orig_key = $value->{$k})) {
+ $v = $value->{$orig_key};
+ } else {
+ $orig_key = $k; # now only used for the 'path' parameter
+ }
+ } else {
+ $v = $value->{$k};
+ }
+ check_prop($v, $schema->{$k}, $path ? "$path.$orig_key" : $orig_key, $errors);