I have a simple api GET request and the response body is just like below. I want to validate the response and check whether below conditions are met.
-
Response array size should always be 2.
-
In each of the array item, the “build.time” value should be a date time.
-
In each of the array item, the “build.artifact” value should be equals to “main_component”.
-
“build.name” value of the 1st array item should equals to “web app”
-
“build.name” value of the 2nd array item should equals to “back-end”.
[
{
“build.time”: “2020-01-24 02:07:03 UTC”,
“build.artifact”: “main_component”,
“build.name”: “web app”,
“build.version”: “1.0.0”
},
{
“build.time”: “2019-07-10 15:26:18 UTC”,
“build.artifact”: “main_component”,
“build.name”: “back-end”,
“build.version”: “1.0.1”
}
]