bbahadur
(Bharat Bahadur)
2
Hey @spacecraft-astronau2 , Welcome to the community
I think what you are looking for, is to validate the property. You can use ‘.hasOwnProperty’ method to check for it:
//example
pm.test("Properties validated",()=>{
pm.expect(response.hasOwnProperty('a')).to.be.true;
pm.expect(response.hasOwnProperty('b')).to.be.true;
pm.expect(response.hasOwnProperty('c')).to.be.false;
// .....etc
})
If your response includes an array of data, have a look at this scenario:
Good luck
Hope it helps.