Open wwoods opened 3 years ago
import schema schema.Schema({schema.And(str, lambda x: '-' in x, error="Helpful error message"): int}).validate({'hey': 8, 'yo-there': 9})
Expected: the user would get the "Helpful error message" pointing at the key name.
Actual: SchemaWrongKeyError: Wrong key 'hey' in {'hey': 8, 'yo-there': 9}
SchemaWrongKeyError: Wrong key 'hey' in {'hey': 8, 'yo-there': 9}
Any update about this issue? i came here with the same problem using schema.Regex as a key validator. If you guys want, i can make a PR changing that
schema.Regex
Expected: the user would get the "Helpful error message" pointing at the key name.
Actual:
SchemaWrongKeyError: Wrong key 'hey' in {'hey': 8, 'yo-there': 9}