You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, an invalid exception is raised for schema2:
› python3 pm_test.py
schema1
{'platform': 'hello'}
schema2
Traceback (most recent call last):
File "pm_test.py", line 20, in <module>
print(schema2(data))
File "/Users/paulus/dev/python/home-assistant/lib/python3.4/site-packages/voluptuous-0.9.2-py3.4.egg/voluptuous/schema_builder.py", line 192, in __call__
File "/Users/paulus/dev/python/home-assistant/lib/python3.4/site-packages/voluptuous-0.9.2-py3.4.egg/voluptuous/schema_builder.py", line 486, in validate_dict
File "/Users/paulus/dev/python/home-assistant/lib/python3.4/site-packages/voluptuous-0.9.2-py3.4.egg/voluptuous/schema_builder.py", line 324, in validate_mapping
voluptuous.error.MultipleInvalid: required key not provided @ data['platform']
The text was updated successfully, but these errors were encountered:
Running voluptuous 0.9.2
Extending a dictionary validating schema will not work if one of the existing keys is overwritten and made required.
Given this code, you would expect both schema's to pass the data:
However, an invalid exception is raised for
schema2
:The text was updated successfully, but these errors were encountered: