JSON Response
{
Feed[
{"item_type":"cycle","id":123},
{"item_type":"computer","name":"mac"},
{"item_type":"Bag","weight":"2"}
]
}
As nested schema is changing based on item type
so can we compare schema based on item type?
example: if item_type is cycle then it should compare with id,
if item_type is computer then it should compare name like this
I have tried with below:
* def schema = {item_type:"#string",id:'##number',name: '##string',weight:'##string'}
in this schema validation even item_type is cycle and name is mac, test cases will pass but in actual it should fail