def validation_exception(e: ValidationError) -> tuple: return jsonify( build_error( code=400, message='Validation error', # TODO: generate better details details=e.normalized_messages())), 400
def _parse_validation(exp: ValidationError): return ParsedError(type(exp).__name__, f"Validation error", info=exp.normalized_messages())