Skip to content

CONSOLIDATED - NOT IN SET

Description

The NOT IN SET validator is designed to ensure that a field's value is not within a provided set of values. This validator is particularly useful for data validation in scenarios where certain values are considered invalid or an error. It supports both STRING and INTEGER data types, making it versatile for various data validation needs.


Config Location

To configure the NOT IN SET validator, you need to define it within the consDPValidators section of your data point configuration within the schema. This involves specifying the validator name and entity.


Supported Data Types

  • STRING
  • INTEGER

Config Requirements

Config ({}) options are required for the NOT IN SET validator. If no configuration is provided or if the configuration is improperly set up, a block violation will be thrown. For more information on Apiro violations and their appearance in the Apiro UI or logs, refer to the violations section.


Example Config

Below is an example of how to configure the NOT IN SET validator in XML format. This example demonstrates a validator that checks if the "NAME" data point is not within a specified set of values, with the option to ignore case sensitivity.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<dataPoint name="NAME" dataType="STRING">
    <consDPValidators>
        <consDPValidator name="CHECK_NOT_IN_SET" entity="NOT_IN_SET">
            <config>
                <![CDATA[
                    {
                        "options" : ["Joe","Will","Tony","Briggs"],
                        "ignoreCase" : true
                    }
                ]]>
            </config>
        </consDPValidator>
    </consDPValidators>
</dataPoint>

Example Result

  • the NOT IN SET validator will compare the current "NAME" value against the specified set of values. If the value is found within the set, a violation will be triggered, indicating that the value does not meet the criteria for acceptability.

Config Parameters

name acceptable values comment
options An array of strings or integers representing the set of unacceptable values. This defines the set of values that the field's value must not be within.
ignoreCase A boolean value indicating whether to ignore case sensitivity in the comparison. If set to true, the validator will ignore case when comparing values.

Common Mistakes

  • Ensure that the validator name and entity are correctly defined in the configuration to ensure that the validator is correctly identified and applied during the data processing pipeline.
  • Verify that the configuration parameters within the <config> tag are correctly written and match the expected format and values.
  • Remember that the configuration for the NOT IN SET validator is required. If no configuration, or improper configuration is provided then a block violation will be thrown.