MCPcopy Create free account
hub / github.com/alphagov/notifications-api / validate

Function validate

app/schema_validation/__init__.py:128–133  ·  view source on GitHub ↗
(json_to_validate, schema)

Source from the content-addressed store, hash-verified

126
127
128def 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
136def build_error_message(errors):

Calls 2

ValidationErrorClass · 0.85
build_error_messageFunction · 0.85