I'm looking to validate the datetime type with custom validator, rather than the built in one.
The code looks like this:
schema_text = """
run_date:
type: datetime
required: true
"""
s.schema = yaml.load(schema_text)
s.validate(yaml.load("run_date: 2017-01-01T00:00+00:00:00"))
I could do this using checks_with: my_custom_validator
, which would be ok but I'm hoping to open these schemas up to the public, so asking them all to contribute to them would be a bother. I think this could also be done using a normalizer but, again, I'd prefer not to munge with the input.
Any suggestions here? The dateutil
parser is exactly what I want to use.