Custom Known Value Checks
Custom known value checks can be created by implementing the knownvalue.Check interface.
For example, a StringContains
implementation could look as follows:
CheckValue
Method Implementation
The other
parameter passed to the CheckValue
method is one of the following types:
- bool
- map[string]any
- []any
- string
Note: Numerical values will be of type json.Number
, with an underlying type of string
.
Refer to the following built-in known value checks for implementations that handle the different types that can be passed to the CheckValue
method in the other
parameter: