assert(response[prop]!==null,'"'+prop+'" was null, but schema does not specify it to be a nullable property (path: '+path+', context: '+context+')');
switch(schema[prop].type){
case'string':
assert.strictEqual(typeofresponse[prop],'string','"'+prop+'" was expected to be a string, but was '+typeofresponse[prop]+' instead (path: '+path+', context: '+context+')');
break;
case'boolean':
assert.strictEqual(typeofresponse[prop],'boolean','"'+prop+'" was expected to be a boolean, but was '+typeofresponse[prop]+' instead (path: '+path+', context: '+context+')');
break;
case'object':
assert.strictEqual(typeofresponse[prop],'object','"'+prop+'" was expected to be an object, but was '+typeofresponse[prop]+' instead (path: '+path+', context: '+context+')');
assert.strictEqual(Array.isArray(response[prop]),true,'"'+prop+'" was expected to be an array, but was '+typeofresponse[prop]+' instead (path: '+path+', context: '+context+')');
if(schema[prop].items){
case'string':
assert.strictEqual(typeofresponse[prop],'string','"'+prop+'" was expected to be a string, but was '+typeofresponse[prop]+' instead (path: '+path+', context: '+context+')');
break;
case'boolean':
assert.strictEqual(typeofresponse[prop],'boolean','"'+prop+'" was expected to be a boolean, but was '+typeofresponse[prop]+' instead (path: '+path+', context: '+context+')');
break;
case'object':
assert.strictEqual(typeofresponse[prop],'object','"'+prop+'" was expected to be an object, but was '+typeofresponse[prop]+' instead (path: '+path+', context: '+context+')');
assert.strictEqual(Array.isArray(response[prop]),true,'"'+prop+'" was expected to be an array, but was '+typeofresponse[prop]+' instead (path: '+path+', context: '+context+')');
if(schema[prop].items){
// Ensure the array items have a schema defined
assert(schema[prop].items.type||schema[prop].items.allOf,'"'+prop+'" is defined to be an array, but its items have no schema defined (path: '+path+', context: '+context+')');
assert.strictEqual(typeofitem,schema[prop].items.type,'"'+prop+'" should have '+schema[prop].items.type+' items, but found '+typeofitems+' instead (path: '+path+', context: '+context+')');
});
assert(schema[prop].items.type||schema[prop].items.allOf,'"'+prop+'" is defined to be an array, but its items have no schema defined (path: '+path+', context: '+context+')');
assert.strictEqual(typeofitem,schema[prop].items.type,'"'+prop+'" should have '+schema[prop].items.type+' items, but found '+typeofitems+' instead (path: '+path+', context: '+context+')');