How to write a scheme to check the fields in the response?

{ "data": [ { "id": 558, "name": "Riyadh", "type": 2 } ] } 

wrote such code

 const schema = { "data": [ "id", "name", "type"], }; var data = JSON.parse(responseBody); pm.test('Body is correct', function() { pm.expect(tv4.validate(data, schema)).to.be.true; }); 

when I change the name of the field, it writes vseravno that the test has passed, despite the fact that there is no field in the response

    1 answer 1

    If the field is mandatory in response, then it must be specified in the scheme as required.

     "required": ["id", "name", "type"] 

    I recommend https://www.jsonschema.net/