lib/mock/semantic-request.js
function lastPathSegmentIsAParameter (req) {
  let lastSlash = req.swagger.pathName.lastIndexOf("/");
  let lastParam = req.swagger.pathName.lastIndexOf("{");
  return (lastParam > lastSlash);
}
function lastPathSegmentIsAParameter (req) {
  let lastSlash = req.swagger.pathName.lastIndexOf("/");
  let lastParam = req.swagger.pathName.lastIndexOf("{");
  return (lastParam > lastSlash);
}
function lastPathSegmentIsAParameter ( req ) { let lastSlash = req . swagger . pathName . lastIndexOf ( "/" ) ; let lastParam = req . swagger . pathName . lastIndexOf ( "{" ) ; return ( lastParam > lastSlash ) ; }
Determines whether the last path segment is a Swagger parameter.

For example, the following paths are all considered to be resource requests,
because their final path segment contains a parameter:

- /users/{username}
- /products/{productId}/reviews/review-{reviewId}
- /{country}/{state}/{city}

Conversely, the following paths are all considered to be collection requests,
because their final path segment is NOT a parameter:

- /users
- /products/{productId}/reviews
- /{country}/{state}/{city}/neighborhoods/streets

@param   {Request} req
@returns {boolean}
Determines whether the last path segment is a Swagger parameter .