Pipeline validator
File validation pipeline for processing files against multiple validation rules.
PipelineValidator()
A pipeline for validating files against multiple validation rules.
This class provides a flexible way to validate files by chaining multiple BaseValidator
instances. Each validator is applied sequentially, and validation behavior depends on
the stop_on_failure setting of each validator.
Attributes:
| Name | Type | Description |
|---|---|---|
validators |
list[BaseValidator]
|
A list of |
Initialize the PipelineValidator object.
add_validator(validator)
Add a validator to the validation pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
validator |
BaseValidator
|
The validator to add to the pipeline. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PipelineValidator |
PipelineValidator
|
The validation pipeline object for method chaining. |
validate(file_validation_input)
Validate the file against all configured validation rules.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_validation_input |
ValidatorInput
|
The file validation input object to validate. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ValidatorResult |
ValidatorResult
|
A ValidatorResult object indicating success or failure with an appropriate message. If multiple validations fail, messages are combined with semicolons. |