description:This route can only be used to generate tokens for the same user. In other words, you cannot use this route to generate a token for a different user than the one you are authenticated as.
// Therefore, if the value is actually null, that's a problem (nullable is probably missing)
assert(response[prop]!==null,'"'+prop+'" was null, but schema does not specify it to be a nullable property (path: '+ path +', context: '+context+')');
assert(response[prop]!==null,'"'+prop+'" was null, but schema does not specify it to be a nullable property (path: '+method +' '+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+')');
assert.strictEqual(typeofresponse[prop],'string','"'+prop+'" was expected to be a string, but was '+typeofresponse[prop]+' instead (path: '+method +' '+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+')');
assert.strictEqual(typeofresponse[prop],'boolean','"'+prop+'" was expected to be a boolean, but was '+typeofresponse[prop]+' instead (path: '+method +' '+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(typeofresponse[prop],'object','"'+prop+'" was expected to be an object, but was '+typeofresponse[prop]+' instead (path: '+method +' '+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+')');
assert.strictEqual(Array.isArray(response[prop]),true,'"'+prop+'" was expected to be an array, but was '+typeofresponse[prop]+' instead (path: '+method +' '+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(schema[prop].items.type||schema[prop].items.allOf,'"'+prop+'" is defined to be an array, but its items have no schema defined (path: '+method +' '+path +', context: '+context+')');