How to assert a JSON response which have results in random order everytime ?
For exmaple: Response for GET /cat/cat-123/contains/kitten
{
"action": "get",
"status": "200",
"entities": [
{
"type": "kitten",
"created": 1472669778713,
"modified": 1472669778713,
"alias": "kitten-1",
"name": "kitten-1"
},
{
"type": "kitten",
"created": 1472669781833,
"modified": 1472669781833,
"alias": "kitten-2",
"name": "kitten-2"
}
]
}
Here the response will randomly order kitten-1 and kitten-2 for every GET on this. if I add a JSONPath Match aessrtion $.entities[0].alias = kitten-1 and $.entities[1].alias = kitten-2, it will be PASS now. But it will fail in my next attempt of execution as the value will randonly change and it will become kitten-2 and kitten-1 in order.
How I can add a assertion that the "alias" attribute in response can either be kitten-1 or kitten-2 ??