Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove value enumeration when validating empty list (#397)
The behaviour seems to have been introduced in commit 95489bd that modified the schema of an empty list in order to provide a consistent behaviour between Schema({}) and Schema([]). The commit introduced an enumeration of the incorrect values rather than the expected behaviour of showing the key with the incorrect value. This commit provides the expected behaviour, and is also consistent with the 'pathless' behaviour currently implemented, meaning that - Schema([])([1]) -> 'not a valid value @ data[1]' - Schema({'key': []})({'key': [1]) -> 'not a valid dictionary value @ data['key']. Finally, as new unit test is provided to ensure that the new behaviour remains intact.
- Loading branch information