Skip to main content

ValidationRule

A validation rule applied to a field after parsing

ruleIdstringrequired

Unique identifier for this rule within the spec

Example: vr-001
fieldstringrequired

Name of the field this rule applies to

Example: amount
ruleTypeRuleType (string)required

Type of validation rule

Possible values: [NOT_NULL, NOT_EMPTY, MIN_LENGTH, MAX_LENGTH, EXACT_LENGTH, REGEX, MIN_VALUE, MAX_VALUE, BETWEEN, ALLOWED_VALUES, CUSTOM_EXPRESSION, CROSS_FIELD]

Example: MIN_VALUE
valuestring

Primary comparison value (e.g. min value, regex pattern, allowed list)

Example: 0
secondaryValuestring

Upper bound for BETWEEN rules

Example: 999999
messagestringrequired

Human-readable error message when the rule fails

Example: Amount must be non-negative
severitySeverity (string)

Severity level of a validation error

Possible values: [INFO, WARNING, ERROR, FATAL]

Example: ERROR
ValidationRule
{
"ruleId": "vr-001",
"field": "amount",
"ruleType": "MIN_VALUE",
"value": "0",
"secondaryValue": "999999",
"message": "Amount must be non-negative",
"severity": "ERROR"
}