After reading about schema validation I came across both of the code snippets below. but I’m not sure I understand the difference between the two. Is anybody able to explain the difference or point me to relevant documentation?
pm.test("Validating the GraphQL schema", () => {
pm.response.to.have.jsonSchema(schema);
});
let jsonData = pm.response.json();
pm.test('Ensure expected response structure', function () {
let validation = tv4.validate(jsonData, schema);
pm.expect(validation).to.be.true;
});