Subject: | unique in map doesn't work |
unique in map doens't work because the key of $unique_mapping_val isn't
correct.
I attached the patch for this bug. Could you apply it?
Subject: | unique_in_map.patch |
--- Kwalify.pm.orig 2009-08-18 19:48:22.000000000 +0900
+++ Kwalify.pm 2009-08-18 19:52:21.000000000 +0900
@@ -355,10 +355,11 @@
}
my $unique = _get_boolean($subschema->{unique});
if ($unique) {
- if (defined $unique_mapping_val->{$key}->{val} && $unique_mapping_val->{$key}->{val} eq $data->{$key}) {
- $self->_error("'$data->{$key}' is already used at '$unique_mapping_val->{$key}->{path}'");
+ if (defined $unique_mapping_val->{$data->{$key}}->{val}
+ && $unique_mapping_val->{$data->{$key}}->{val} eq $data->{$key}) {
+ $self->_error("'$data->{$key}' is already used at '$unique_mapping_val->{$data->{$key}}->{path}'");
} else {
- $unique_mapping_val->{$key} = { val => $data->{$key},
+ $unique_mapping_val->{$data->{$key}} = { val => $data->{$key},
path => $subpath,
};
}