JSON schema validation troubles

Hi all,

I’ve got a JSON schema that holds all my request and response entities. It is a draft-04. When validating my response like this:

tv4.addSchema(globalSchema);                
const valResult = tv4.validate(data, schema);

the error object I get is missing dataPath and schemaPath, making it hard for my user to find out where the actual problem is. Is there a way to get those properties? (tried validateResult and validateMultiple to no avail)

As an alternative I tried ajv, but as I am in draft-04, it gives me errors. The advice from their site

var ajv = new Ajv({schemaId: 'id'});
// If you want to use both draft-04 and draft-06/07 schemas:
// var ajv = new Ajv({schemaId: 'auto'});
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json'));

does not work because Postman does not allow me to require that… any thoughts?

Groeten,

Friso