(json_to_validate, schema)
| 126 | |
| 127 | |
| 128 | def validate(json_to_validate, schema): |
| 129 | validator = Draft7Validator(schema, format_checker=format_checker) |
| 130 | errors = list(validator.iter_errors(json_to_validate)) |
| 131 | if errors.__len__() > 0: |
| 132 | raise ValidationError(build_error_message(errors)) |
| 133 | return json_to_validate |
| 134 | |
| 135 | |
| 136 | def build_error_message(errors): |