dbt-labs / hologram

A library for automatically generating Draft 7 JSON Schemas from Python dataclasses
MIT License
9 stars 13 forks source link

Make ValidationError match jsonschema.ValidationError, cache schemas #20

Closed beckjake closed 5 years ago

beckjake commented 5 years ago

This PR raises a ValidationError that contains the full rich information provided by jsonschema, so we can use it to make the output a bit shorter when dbt displays errors about failed validations. Nobody cares about the full schema most of the time!

Also, during validation, cache calls to validate_schema/json_schema - this is a bit convoluted because you can't hash dicts, but you can hash types.