I edited my schema like normal in a request’s Tests. Ran it and it appeared to work correctly.
I cut/pasted the schema to a Collection variable with the name ttSchema. Updated my request test with
var Ajv = require('ajv'),
ajv = new Ajv({logger: console, allErrors: true, verbose: true}),
schema = pm.variables.get("ttSchema");
pm.test('Schema is valid', function() {
pm.expect(ajv.validate(schema, pm.response.json())).to.be.true;
});
And this is the result of running the request
FAIL Schema is valid | Error: no schema with key or ref "{ "type": "object", "properties": { "employee": {...
My whole schema definition is displayed in the above message.
Any advice?