# JSON schema validation troubles

**URL:** <https://community.postman.com/t/json-schema-validation-troubles/5024>\
**Category:** Help Hub\
**Tags:** json, schema, ajv, tv4\
**Created:** [April 17, 2019, 8:32am UTC](https://community.postman.com/t/json-schema-validation-troubles/5024 "2019-04-17T08:32:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vrolijken](https://avatars.discourse-cdn.com/v4/letter/v/a87d85/32.png) [@vrolijken](https://community.postman.com/u/vrolijken)\
**Post date:** [April 17, 2019, 8:32am UTC](https://community.postman.com/t/json-schema-validation-troubles/5024/1 "2019-04-17T08:32:38Z")

</div>

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:

```auto
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

```auto
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

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [May 7, 2025, 8:01pm UTC](https://community.postman.com/t/json-schema-validation-troubles/5024/2 "2025-05-07T20:01:03Z")

</div>

Closed on May 7, 2025, 8:01pm UTC


