lib/request-metadata.js
function pathMatches (path, swaggerPath) {
  // Convert the Swagger path to a RegExp
  let pathPattern = swaggerPath.replace(util.swaggerParamRegExp, (match, paramName) => {
    return "([^/]+)";
  });

  // NOTE: This checks for an EXACT, case-sensitive match
  let pathRegExp = new RegExp("^" + pathPattern + "$");

  return pathRegExp.test(path);
}
function pathMatches (path, swaggerPath) {
  // Convert the Swagger path to a RegExp
  let pathPattern = swaggerPath.replace(util.swaggerParamRegExp, (match, paramName) => {
    return "([^/]+)";
  });

  // NOTE: This checks for an EXACT, case-sensitive match
  let pathRegExp = new RegExp("^" + pathPattern + "$");

  return pathRegExp.test(path);
}
function pathMatches ( path , swaggerPath ) { // Convert the Swagger path to a RegExp let pathPattern = swaggerPath . replace ( util . swaggerParamRegExp , ( match , paramName ) => { return "([^/]+)" ; } ) ; // NOTE: This checks for an EXACT, case-sensitive match let pathRegExp = new RegExp ( "^" + pathPattern + "$" ) ; return pathRegExp . test ( path ) ; }
Determines whether the given HTTP request path matches the given Swagger path.

@param   {string}    path        - The request path (e.g. "/users/jdoe/orders/1234")
@param   {string}    swaggerPath - The Swagger path (e.g. "/users/{username}/orders/{orderId}")
@returns {boolean}
Determines whether the given HTTP request path matches the given Swagger path .