[
{
“accepted”: true,
“bot”: {
“code”: “xxx”,
“key_types”: [
{
“code”: “xxx”,
“value”: “xxx”
}
]
},
“delete_application_code”: “xxx”,
“deleted”: true,
“deletion_refusal_reason”: “”,
“master_application_code”: “xxx”,
“refusal”: {
“code”: “1201”,
“reason”: “xxx-xxx-x-xxx-xxxx”
}
},
{
“accepted”: true,
“bot”: {
“code”: “xxx”,
“key_types”: [
{
“code”: “xxx”,
“value”: “xxx”
}
]
},
“delete_application_code”: “xxx”,
“deleted”: true,
“deletion_refusal_reason”: “”,
“master_application_code”: “xxx”,
“refusal”: {
“code”: “1201”,
“reason”: “xxx-xxx-x-xxx-xxxx”
}
},
{
“accepted”: true,
“bot”: {
“code”: “xxx”,
“key_types”: [
{
“code”: “xxx”,
“value”: “xxx”
}
]
},
“delete_application_code”: “xxx”,
“deleted”: true,
“deletion_refusal_reason”: “”,
“master_application_code”: “xxx”,
“refusal”: {
“code”: “1201”,
“reason”: “xxx-xxx-x-xxx-xxxx”
}
}
]
This is my response Body and here i want to validate the field value in this list " accepted": true"
Below is the code i wrote:
var jsonData = pm.response.json();
console.log(typeof jsonData);
var responseSchema={
"type": "object",
"title": "accepted",
"description": "This is an Delete Statuses Rest Service",
"required": [
"accepted"
],
"properties": {
"bot": {
"type": "object"
},
}
};
pm.test(“DELETE accepted should be TRUE”,function(){
pm.expect(tv4.validate(jsonData, responseSchema)).to.be.true;
});
But i see that the assertion is failing with below error even if the value is true for all the fields in the List
DELETE accepted should be TRUE | AssertionError: expected false to be true
Kindly suggest or correct me if anything is incorrect