Checking a schema with tv4

Hey @Coxjeffrey,

I would recommend using Ajv over tv4, this also comes as part of the Postman app.

You can use this example to check your response against the schema:

var Ajv = require('ajv'),
    ajv = new Ajv({ logger: console, allErrors: true }),
    schema = {
   "type":"object",
   "required":[
      "Id",
      "Progress",
      "Status",
      "Info",
      "Created",
      "Ended",
      "Operation",
      "Requested"
   ],
   "properties":{
      "Id":{
         "$id":"#/properties/Id",
         "type":"string"
      },
      "Progress":{
         "$id":"#/properties/Progress",
         "type":"string"
      },
      "Status":{
         "$id":"#/properties/Status",
         "type":"string"
      },
      "Info":{
         "$id":"#/properties/Info",
         "type":"null"
      },
      "Created":{
         "$id":"#/properties/Created",
         "type":"string"
      },
      "Ended":{
         "$id":"#/properties/Ended",
         "type":"null"
      },
      "Operation":{
         "$id":"#/properties/Operation",
         "type":"string"
      },
      "Requested":{
         "$id":"#/properties/Requested",
         "type":"array",
         "items":{
            "$id":"#/properties/Requested/items",
            "type":"string"
         }
      }
   }
}

pm.test('Schema is valid', function() {
    pm.expect(ajv.validate(schema, pm.response.json()), JSON.stringify(ajv.errors)).to.be.true;
});