Resolve repair budgets from validation modes
This commit is contained in:
@@ -8,6 +8,19 @@ import (
|
||||
|
||||
const maxOutputRepairAttempts = 3
|
||||
|
||||
// ResolveRepairAttempts selects a concrete budget for a validation mode.
|
||||
func ResolveRepairAttempts(mode ValidationMode, attempts *int) int {
|
||||
if attempts != nil {
|
||||
return *attempts
|
||||
}
|
||||
switch mode {
|
||||
case ValidationBasic, ValidationJSON, ValidationJSONSchema:
|
||||
return 1
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
// ValidateOutputContract validates source-neutral output-contract invariants.
|
||||
func ValidateOutputContract(contract OutputContract) error {
|
||||
switch contract.Format {
|
||||
|
||||
Reference in New Issue
Block a user