Key
Key(reference: str, rule=None, mandatory: bool = True)
Validates an array key.
You can also validate the key value itself:
Third parameter makes the key presence optional:
v.key('lorem', v.stringType()).validate(test_dict) # false
v.key('lorem', v.stringType(), False).validate(test_dict) # true
The name of this validator is automatically set to the key name.
Categorization
- Arrays
- Nesting
- Structures
Changelog
Version | Description |
---|---|
1.0.0 | Created |
See also: