This commit is contained in:
gongwenxin
2025-05-26 15:38:37 +08:00
parent 4180a0ce81
commit 6dde4d73e0
29 changed files with 3552 additions and 1265 deletions
@@ -20,22 +20,22 @@ logger = logging.getLogger(__name__)
class ValidationResult:
"""Validation result container"""
def __init__(self, is_valid: bool, errors: List[str] = None, warnings: List[str] = None):
def __init__(self, passed: bool, errors: List[str] = None, warnings: List[str] = None):
"""
Initialize a validation result
Args:
is_valid: Whether the data is valid according to the schema
passed: Whether the data is valid according to the schema
errors: List of error messages (if any)
warnings: List of warning messages (if any)
"""
self.is_valid = is_valid
self.passed = passed
self.errors = errors or []
self.warnings = warnings or []
def __str__(self) -> str:
"""String representation of validation result"""
status = "Valid" if self.is_valid else "Invalid"
status = "Valid" if self.passed else "Invalid"
result = f"Validation Result: {status}\n"
if self.errors: