# How to use ajv.AddFormats

**URL:** <https://community.postman.com/t/how-to-use-ajv-addformats/24247>\
**Category:** Help Hub\
**Created:** [May 29, 2021, 2:22pm UTC](https://community.postman.com/t/how-to-use-ajv-addformats/24247 "2021-05-29T14:22:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![john-quintessence](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@john-quintessence](https://community.postman.com/u/john-quintessence)\
**Post date:** [May 29, 2021, 2:22pm UTC](https://community.postman.com/t/how-to-use-ajv-addformats/24247/1 "2021-05-29T14:22:30Z")

</div>

I want to validate my json schema with ajv. And I specifically want to validate formats. How do I install the ajv AddFormats and use it? I can’t find any instructions on installing ajv addformats in command line or postman that work.

```
var schema = {
"type": "array",
"items": {
    "type": "String",
    "format":"date-time"
}
};

var data1 = ["2025-01-31T00:00:00"];
var data2 = ["Not a time"];

pm.test('Schema is valid', function () {
  //Expect to be True
   pm.expect(data1).to.have.jsonSchema(schema);
   //Expect to be False
   pm.expect(data2).to.have.jsonSchema(schema);
});

```
