EQUALS |
= , == , EQUAL |
Checks if field value exactly matches the expected value |
{"field": "status", "mode": "EQUALS", "value": "active"} |
EXISTS |
!! , NOT_NULL , IS_NOT_NULL |
Verifies that the field exists and is not null |
{"field": "id", "mode": "EXISTS"} |
EMPTY |
IS_EMPTY , IS_NULL , NULL |
Verifies that the field either doesn't exist or is null |
{"field": "deleted_at", "mode": "EMPTY"} |
NOT_EXISTS |
NOT_EXIST |
Verifies that the field does not exist in the response |
{"field": "password", "mode": "NOT_EXISTS"} |
NOT_EQUAL |
!= , <> |
Checks if field value is different from the expected value |
{"field": "status", "mode": "!=", "value": "deleted"} |
CONTAINS |
-> |
Checks if an array or string contains the specified value |
{"field": "roles", "mode": "CONTAINS", "value": "admin"} |
SIZE |
LEN , LENGTH |
Checks if array length or string length equals the specified value |
{"field": "items", "mode": "SIZE", "value": 10} |
GT |
> |
Checks if numeric value is greater than specified value |
{"field": "count", "mode": "GT", "value": 0} |
GTE |
>= |
Checks if numeric value is greater than or equal to specified value |
{"field": "price", "mode": "GTE", "value": 100} |
LT |
< |
Checks if numeric value is less than specified value |
{"field": "stock", "mode": "LT", "value": 50} |
LTE |
<= |
Checks if numeric value is less than or equal to specified value |
{"field": "errors", "mode": "LTE", "value": 0} |
SIZE-GT |
()> |
Checks if array/string length is greater than specified value |
{"field": "users", "mode": "SIZE-GT", "value": 5} |
SIZE-GTE |
()>= |
Checks if array/string length is greater than or equal to specified value |
{"field": "products", "mode": "SIZE-GTE", "value": 10} |
SIZE-LT |
()< |
Checks if array/string length is less than specified value |
{"field": "tags", "mode": "SIZE-LT", "value": 5} |
SIZE-LTE |
()<= |
Checks if array/string length is less than or equal to specified value |
{"field": "errors", "mode": "SIZE-LTE", "value": 3} |
OBJ |
OBJECT |
Validates that the field is an object matching the specified structure |
{"field": "user", "mode": "OBJ", "value": {"id": "EXISTS", "name": "EXISTS"}} |