Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving the validation experience #19

Merged
merged 11 commits into from Oct 18, 2018
Merged

Improving the validation experience #19

merged 11 commits into from Oct 18, 2018

Conversation

thekaveman
Copy link
Contributor

@thekaveman thekaveman commented Oct 17, 2018

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

Still WIP, pending further error output improvements.

@thekaveman
Copy link
Contributor Author

thekaveman commented Oct 18, 2018

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

  - page-level errors (e.g. missing or invalid version, missing payload)
  - payload-level errors (e.g. malformed payload envelope)
  - item-level errors (e.g. missing required fields, invalid enum values)
@thekaveman
Copy link
Contributor Author

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

@thekaveman thekaveman merged commit bb43c24 into master Oct 18, 2018
@thekaveman thekaveman deleted the validation branch October 19, 2018 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant