I started to use schema to check the config files of my projects and I really started to like it.
In my last project I had an occurrence when validating the following python dictionary:
With the following schema:
I got the follwing error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/dominik/Projekte/path_to_script/venv/lib/python3.6/site-packages/schema.py", line 398, in validate
raise SchemaError([message] + x.autos, [e] + x.errors)
schema.SchemaError: Key 'data_sys' error:
Key 'dns' error:
Key 'zone' error:
{'user.zone.tld.': {'email': 'user@zone.tld', 'type_': 'PLACEHOLDER'}} should be instance of 'list'
But when checking my validation schema, I don't use any [ ] to describe a list at zone.
//Edit:
Look like to me that the list gets added around zone after calling the Schema function.(see schema object).
//Edit:
Original python dict for generating schema instance.
//Edit:
Problem solved by reworking python dict.
Hello Keleshev,
I started to use schema to check the config files of my projects and I really started to like it. In my last project I had an occurrence when validating the following python dictionary:
With the following schema: I got the follwing error:
But when checking my validation schema, I don't use any [ ] to describe a list at zone.
//Edit: Look like to me that the list gets added around zone after calling the Schema function.(see schema object). //Edit: Original python dict for generating schema instance. //Edit: Problem solved by reworking python dict.