Config Validator: schema_with_slug_keys (#20298)
* schema_with_slug_keys * Update config_validation.py * Update config_validation.py
This commit is contained in:
parent
4b3cdb9f4e
commit
6511e11ec9
38 changed files with 66 additions and 66 deletions
|
@ -329,6 +329,9 @@ def schema_with_slug_keys(value_schema: Union[T, Callable]) -> Callable:
|
|||
|
||||
def verify(value: Dict) -> Dict:
|
||||
"""Validate all keys are slugs and then the value_schema."""
|
||||
if not isinstance(value, dict):
|
||||
raise vol.Invalid('expected dictionary')
|
||||
|
||||
for key in value.keys():
|
||||
slug(key)
|
||||
return schema(value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue