lib/request-validator.js
function requestValidator (context) {
  return [http500, http401, http404, http405, http406, http413, http415];

  /**
   * Throws an HTTP 500 error if the Swagger API is invalid.
   * Calling {@link Middleware#init} again with a valid Swagger API will clear the error.
   */
  function http500 (req, res, next) {
    if (context.error) {
      context.error.status = 500;
      throw context.error;
    }

    next();
  }
}
function requestValidator (context) {
  return [http500, http401, http404, http405, http406, http413, http415];

  /**
   * Throws an HTTP 500 error if the Swagger API is invalid.
   * Calling {@link Middleware#init} again with a valid Swagger API will clear the error.
   */
  function http500 (req, res, next) {
    if (context.error) {
      context.error.status = 500;
      throw context.error;
    }

    next();
  }
}
function requestValidator ( context ) { return [ http500 , http401 , http404 , http405 , http406 , http413 , http415 ] ; /**
   * Throws an HTTP 500 error if the Swagger API is invalid.
   * Calling {@link Middleware#init} again with a valid Swagger API will clear the error.
   */ function http500 ( req , res , next ) { if ( context . error ) { context . error . status = 500 ; throw context . error ; } next ( ) ; } }
Validates the HTTP request against the Swagger API.
An error is sent downstream if the request is invalid for any reason.

@param   {MiddlewareContext}    context
@returns {function[]}
Validates the HTTP request against the Swagger API . An error is sent downstream if the request is invalid for any reason .