How to validate json schema using avj and postman
问题 I'm trying to validate the following json that looks like this: { "errors": false, } using this on postman: var Ajv = require('ajv'), ajv = new Ajv({logger: console, coerceTypes: false}), schema = { "errors": { "type": "number" } }; pm.test('Schema is valid', function() { var error = pm.response.json()['errors']; console.log("this is error: " +error); pm.expect(ajv.validate(schema, {errors: error})).to.be.true; }); pm.test('Schema is valid different way', function() { var error = pm.response