JSON Schema has several purposes, one of which is JSON instance validation.
Example JSON 1:
...
Evaluator | JSON Script | Description | |||||
---|---|---|---|---|---|---|---|
AndEvaluator |
| This is used to evaluate an 'And' condition. It evaluates if all the evaluators within the conditions are satisfied or not. | |||||
ContainsEvaluator |
| This does a 'contains' evaluation. This is applicable only for a String field. It evaluates if the specified field contains the string within the condition or not. | |||||
EqualsEvaluator |
| This evaluator evaluates an '=' condition. It evaluates if the specified field is equal to the value mentioned within the condition or not. | |||||
GreaterthanEvaluator |
| This evaluator evaluates an '>' condition. It evaluates if the value in the specified field is greater than the value provided within the condition or not. It enables you to select the data type as number or date as well. | |||||
InEvaluator |
| This does an 'In' evaluation. This converts the field data to a string representation and does the 'in' check. It evaluates if the field value is available in the user defined (comma separated) value provided within the validation JSON or condition. | |||||
LesserthanEvaluator |
| This evaluator evaluates an '<' condition. It evaluates if the value in the specified field is lesser than the value provided within the condition or not. It enables you to select the data type as number or date as well. | |||||
NotEqualsEvaluator |
| This evaluator evaluates the 'Not equals' condition. It evaluates if the value in the specified field is not equal to the value provided within the condition or not. | |||||
NotGreaterthanEvaluator |
| This class evaluates the 'Not greaterthan' condition. It evaluates if the value in the specified field is not greater than the value provided within the condition or not. It enables you to select the data type as number or date as well. | |||||
NotInEvaluator |
| This does a "Not In" evaluation. This converts the field data to a string representation and does the 'Not in' check. It evaluates if the field value is not available in the user defined (comma separated) value provided within the validation JSON or condition. | |||||
NotLesserthanEvaluator |
| This class evaluates the 'Not lesserthan' condition. It evaluates if the value in the specified field is not lesser than the value provided within the condition or not. It enables you to select the data type as number or date as well. | |||||
NotNullEvaluator |
| This class evaluates the 'is Not Null' condition. The value within the specified field should not be null to satisfy this condition. | |||||
NullEvaluator |
| This class evaluates the 'is Null' condition. The value within the specified field should be null to satisfy this condition. | |||||
OrEvaluator |
| This is used to evaluate an 'Or' condition. It evaluates if at least one of the evaluators within the conditions are satisfied or not. | |||||
RangeEvaluator |
| This evaluator evaluates a 'between' condition. It evaluates if the value within the specified field is within the value range or not. It enables you to select the data type as number or date as well. | |||||
StartsWithEvaluator |
| This does a 'Starts With' evaluation. This is applicable only for a String field. It evaluates if the value within the specified field starts with the value provided in the condition or not. |
Refer Custom Validation for more information on custom validating the fields in a request.