tmpfs / async-validate

Asynchronous type validation for node and the browser
Other
314 stars 45 forks source link

Error fields key collision (tree) #33

Closed tmpfs closed 8 years ago

tmpfs commented 8 years ago

When a nested field uses the same name as a field at a higher level it would not be possible to distinguish that the error occurred on different properties, consider constructing a tree structure for keyed errors.

tmpfs commented 8 years ago

Rather than trying to maintain a tree structure of errors which would be complex, consider using delimited key identifiers for errors constructed from the field name and the field names of all parent objects, eg: address.street.