Skip to main content

In List Validator

Specification

{
"validatorType": String,
"name": String,
"description": String,
"fields": FieldSelectorSpec,
"validValues": Array[String],
"isNot": Boolean,
"onNullResult": String,
"castFields": Boolean
}

Structure values

Field NameTypeDescriptionRequiredDefault
validatorTypeStringThe type of validator to constructRequired
nameStringThe name of the validator. Must be unique within the validation suite.Required
descriptionStringExpanded validator information.None
fieldsObjectA Field Selector SpecRequired
validValuesArray[String]An array of values to pass to the SQL IN statement.Required
isNotBooleanFlag for whether to use not in the where clausefalse
onNullResultStringA value of pass, null, or fail that describes how to process null values. Null aggregates them into a null column. Pass aggregates them in with the other passing values. Fail aggregates them in with the other failing values.fail
castFieldsBooleanSpecifies if target fields should be cast to a string prior to validation.false

Example

{
"validatorType": "inList",
"name": "sample_inList_validator",
"description": "I can check enumerated values",
"fields": {
"fieldSelectorType": "Single",
"fieldName": "col_name"
},
"validValues": ["1", "2", "3"],
"isNot": true,
"onNullResult": "pass",
"castFields": false
}