I did a small change in the schema in object status I changed the attribute type to be an integer, it was string originally.
The result is: Postman returns true
code:
var schema = pm.variables.get("schema");
console.log(schema);
var JsoneData=JSON.parse(responseBody);
//var result=tv4.validateResult(JsoneData, schema);
//console.log(result);
pm.test('Schema is valid', function() {
pm.expect(tv4.validate(JsoneData, schema)).to.be.true;
});
I would recommend using Ajv over tv4 within Postman - There have been a few questions around this module recently with some extra information about how it could be used.