docs: function (name, value, schema, options, callback) {
  
      var err
          , nullable = false
          , valCount = 0;
  
      // Set default values
      if (options && options.partial !== true) {
          if (schema.hasOwnProperty('default') && value === undefined) {
              if ((_.isString(schema.default) || _.isBoolean(schema.default) || _.isNumber(schema.default)) || (schema.hasOwnProperty('nullable') && schema.nullable === true && _.isNull(schema.default))) {
                  value = schema.default;
              }
              else {
                  if (_.isFunction(schema.default)) {
                      value = (schema.default)();
                  }
                  else {
                      err = _.assign({
                          code: 'UnexpectedDefaultValue',
                          'id': name,
                          msg: name + ' default value is faulty. ' + typeof(schema.default) + ' given but not expected'
                      }, err);
                  }
              }
          }
      }
      if (value !== undefined) {
  
          // Check if null value set and is allowed
          if ((schema.hasOwnProperty('nullable') && schema.nullable === true) && value == null) {
              value = null;
          }
          else {
              //Check type
              if (schema.hasOwnProperty('type')) {
                  var type = schema.type;
                  if (_.isFunction(type) && type.name.toLowerCase()) {
                      type = type.name.toLowerCase();
                  }
                  var validValue = validationRule.checkType(type, value);
                  if (validValue === undefined) {
                      err = _.assign({
                          code: 'UnexpectedType',
                          'id': name,
                          msg: name + ' is unexpected type. ' + typeof(value) + ' given ' + type.toLowerCase() + ' expected'
                      }, err);
                  }
                  else {
                      value = validValue;
                  }
              }
  
              //Validate single value
              if ((_.isString(value) || _.isBoolean(value) || _.isNumber(value))) {
  
                  //Check minLength
                  if (schema.hasOwnProperty('minLength')) {
                      if (validationRule.minLength(schema.minLength, value) == false) {
                          err = _.assign({
                              code: 'MinLengthUnderachieved',
                              'id': name,
                              msg: name + ' length is less than ' + schema.minLength + ' chars'
                          }, err);
                      }
                  }
  
                  //Check maxLength
                  if (schema.hasOwnProperty('maxLength')) {
                      if (validationRule.maxLength(schema.maxLength, value) == false) {
                          err = _.assign({
                              code: 'MaxLengthExceeded',
                              'id': name,
                              msg: name + ' length is more than ' + schema.maxLength + ' chars'
                          }, err);
                      }
                  }
  
  
                  //Check min
                  if (schema.hasOwnProperty('min')) {
                      if (typeof(value) == 'number') {
                          if (validationRule.min(schema.min, value) == false) {
                              err = _.assign({
                                  code: 'MinValueUnderachived',
                                  'id': name,
                                  msg: name + ' value is less than ' + schema.min
                              }, err);
                          }
                      }
                  }
  
                  //Check max
                  if (schema.hasOwnProperty('max')) {
                      if (typeof(value) == 'number') {
                          if (validationRule.max(schema.max, value) == false) {
                              err = _.assign({
                                  code: 'MaxValueExceeded',
                                  'id': name,
                                  msg: name + ' value is more than ' + schema.max
                              }, err);
                          }
                      }
                  }
  
                  //Check allow
                  if (schema.hasOwnProperty('allow')) {
                      if (typeof(value) == 'number' || typeof(value) == 'string') {
                          if (validationRule.allow(schema.allow, value) == false) {
                              err = _.assign({
                                  code: 'ValueNotAllowed',
                                  'id': name,
                                  msg: name + ' value \'' + value + '\' is not allowed. Use one of the following values: ' + (schema.allow).join(",")
                              }, err);
                          }
                      }
                  }
  
                  //Check deny
                  if (schema.hasOwnProperty('deny')) {
                      if (typeof(value) == 'number' || typeof(value) == 'string') {
                          if (validationRule.deny(schema.deny, value) == false) {
                              err = _.assign({
                                  code: 'ValueNotAllowed',
                                  'id': name,
                                  msg: name + ' value \'' + value + '\' is not allowed. Do not use one of the following values: ' + (schema.deny).join(",")
                              });
                          }
                      }
                  }
  
                  //Check match
                  if (schema.hasOwnProperty('match')) {
                      if (validationRule.match(schema.match, value) == false) {
                          err = _.assign({
                              code: 'PatternMismatch',
                              'id': name,
                              msg: name + ' does not match pattern ' + schema.match + ''
                          }, err);
                      }
                  }
  
  
                  // Convert values
                  value = convert.convertValue(schema, value);
              }
          }
  
          //Validate Array
          if (_.isArray(value)) {
              for (var thisVal in value) {
                  valCount++;
                  // Check if null value set and is allowed
                  if ((schema.hasOwnProperty('nullable') && schema.nullable === true) && value == null) {
                      value = null;
                  }
                  else {
                      //Check type
                      if (schema.hasOwnProperty('subType')) {
                          if (_.isFunction(schema.subType) && (schema.subType.name).toLowerCase()) {
                              schema.subType = (schema.subType.name).toLowerCase();
                          }
                          var validSubValue = validationRule.checkType(schema.subType, value[thisVal]);
                          if (validSubValue === undefined) {
                              err = _.assign({
                                  code: 'UnexpectedType',
                                  'id': name,
                                  msg: name + '[' + valCount + ']' + ' is unexpected type. ' + typeof(value[thisVal]) + ' given ' + (schema.subType).toLowerCase() + ' expected'
                              }, err);
                          }
                          else {
                              value[thisVal] = validSubValue;
                          }
                      }
  
                      //Check minLength
                      if (schema.hasOwnProperty('minLength')) {
                          if (validationRule.minLength(schema.minLength, value[thisVal]) == false) {
                              err = _.assign({
                                  code: 'MinLengthUnderachieved',
                                  'id': name,
                                  msg: name + '[' + valCount + ']' + ' length is less than ' + schema.minLength + ' chars'
                              }, err);
                          }
                      }
  
                      //Check maxLength
                      if (schema.hasOwnProperty('maxLength')) {
                          if (validationRule.maxLength(schema.maxLength, value[thisVal]) == false) {
                              err = _.assign({
                                  code: 'MaxLengthExceeded',
                                  'id': name,
                                  msg: name + '[' + valCount + ']' + ' length is more than ' + schema.maxLength + ' chars'
                              }, err);
                          }
                      }
  
  
                      //Check min
                      if (schema.hasOwnProperty('min')) {
                          if (typeof(value) == 'number') {
                              if (validationRule.min(schema.min, value[thisVal]) == false) {
                                  err = _.assign({
                                      code: 'MinValueUnderachived',
                                      'id': name,
                                      msg: name + '[' + valCount + ']' + ' value is less than ' + schema.min
                                  }, err);
                              }
                          }
                      }
  
                      //Check max
                      if (schema.hasOwnProperty('max')) {
                          if (typeof(value) == 'number') {
                              if (validationRule.max(schema.max, value[thisVal]) == false) {
                                  err = _.assign({
                                      code: 'MaxValueExceeded',
                                      'id': name,
                                      msg: name + '[' + valCount + ']' + ' value is more than ' + schema.max
                                  }, err);
                              }
                          }
                      }
  
                      //Check allow
                      if (schema.hasOwnProperty('allow')) {
                          if (typeof(value) == 'number' || typeof(value[thisVal]) == 'string') {
                              if (validationRule.allow(schema.allow, value[thisVal]) == false) {
                                  err = _.assign({
                                      code: 'ValueNotAllowed',
                                      'id': name,
                                      msg: name + '[' + valCount + ']' + ' value \'' + value[thisVal] + '\' is not allowed. Use one of the following values: ' + (schema.allow).join(",")
                                  }, err);
                              }
                          }
                      }
  
                      //Check deny
                      if (schema.hasOwnProperty('deny')) {
                          if (typeof(value) == 'number' || typeof(value[thisVal]) == 'string') {
                              if (validationRule.deny(schema.deny, value[thisVal]) == false) {
                                  err = _.assign({
                                      code: 'ValueNotAllowed',
                                      'id': name,
                                      msg: name + '[' + valCount + ']' + ' value \'' + value[thisVal] + '\' is not allowed. Do not use one of the following values: ' + (schema.deny).join(",")
                                  });
                              }
                          }
                      }
  
                      //Check match
                      if (schema.hasOwnProperty('match')) {
                          if (validationRule.match(schema.match, value[thisVal]) == false) {
                              err = _.assign({
                                  code: 'PatternMismatch',
                                  'id': name,
                                  msg: name + '[' + valCount + ']' + ' does not match pattern ' + schema.match + ''
                              }, err);
                          }
                      }
                      // Convert values
                      value[thisVal] = convert.convertValue(schema, value[thisVal]);
                  }
              }
          }
      }
  
  
      //Check required
      if (schema.hasOwnProperty('required')) {
          if (options && options.partial !== true) {
              if (schema.required == true && (value == undefined || value == "")) {
                  if ((schema.hasOwnProperty('public') && schema.public.hasOwnProperty('set') && schema.public.set == false) || (schema.hasOwnProperty('nullable') && schema.nullable === true && _.isNull(value))) {
  
                  }
                  else {
                      err = _.assign({
                          code: 'MissingRequiredParameter',
                          id: name,
                          msg: name + ' is required but invalid value or no value given'
                      }, err);
                  }
              }
          }
      }
  
      //Check public
      if (schema.hasOwnProperty('public')) {
          if (schema.public == false || ((schema.public.hasOwnProperty('get') && schema.public.get != true))) {
              value = undefined;
          }
      }
      callback(err, value);
  }