I’m trying to validate this schema and don’t understand why it failed.
var schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"nome": {
"type": "string"
},
"idade": {
"type": "integer"
},
"id": {
"type": "integer"
},
"risco": {
"type": "integer"
}
},
"required": [
"nome",
"idade",
"id",
"risco"
]
}
var jsonData = pm.response.json();
pm.test('Validando a estrutura do body', function() {
pm.expect(tv4.validade(jsonData, schema)).to.be.true;
})
Error Message –
TypeError: tv4.validade is not a function