-
Notifications
You must be signed in to change notification settings - Fork 0
String Predicate
String Predicates are used to test the value of a string or a list of strings.
| Field | Type | Default | Description |
|---|---|---|---|
| whitelist | List of Strings | [] |
The list of allowed strings. |
| blacklist | List of String | [] |
The list of banned strings. |
| whitelist_is_subset | Boolean | false |
Used only for testing collections, if true the whitelist is treated as a list of "required" strings instead and the collection will be allowed to have strings outside the whitelist. |
If the whitelist has values, then the string must be non-null and in the list, otherwise the predicate returns false.
If the whitelist is empty, then the string may be null but it must not be in the blacklist, otherwise the predicate returns false.
If any value in the list is also in the blacklist, the predicate returns false.
If whitelist_is_subset is true, then all values in the whitelist must also be in the list. Values outside of the whitelist are still permitted.
If whitelist_is_subset is false, then every element in the list is tested individually as if it were a single value. The predicate returns true if and only if every element also passes the predicate.
This tests if the input is either "example" or "test". Any other input values will fail.
{
"whitelist": ["example", "test"]
}