code: function middleware(schema, options = optionsDefault) {
      return (req, res, next) => {
          // Test if schema exists
          /* istanbul ignore if */
          if (!schema) {
              next();
          }
  
          // Test if Joi is provided
          const Joi = options.joi || require('joi');
  
          // Object to validate
          const objectToValidate = {};
          ['params', 'body', 'query', 'headers'].forEach((key) => {
              if (schema[key]) {
                  objectToValidate[key] = req[key];
              }
          });
  
          // Get joi options
          const joiOptions = options.joiOptions || {};
  
          // Get callback
          const callback = options.validationCallback || validationCallback;
  
          return Joi.validate(objectToValidate, schema, joiOptions, callback(req, res, next, options));
      };
  }
docs: /* ************************************* /* ********   PUBLIC FUNCTIONS  ******** /* ************************************* 
  Middleware function.
  @param schema {Object} Schema to validate
  @param options {Object} Middleware function
  @returns {Function}