CityofSantaMonica / mds-provider

Python tools for working with MDS Provider data
https://github.com/openmobilityfoundation/mobility-data-specification
MIT License
18 stars 20 forks source link

Improving the validation experience #19

Closed thekaveman closed 6 years ago

thekaveman commented 6 years ago

Both the UX of the module itself and the errors/messages it produces.

Still WIP, pending further error output improvements.

thekaveman commented 6 years ago

Ok, this is pretty good for now. Example usage:

from mds.schema.validation import ProviderDataValidator

v = ProviderDataValidator(schema_type="status_changes", ref="dev")
data = {}

for error in v.validate(data):
    print(error)

Outputs:

'version' is a required property
'data' is a required property
thekaveman commented 6 years ago

See the wiki for an up-to-date usage example.