Skip to content

Commit

Permalink
fix path finder
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Mar 22, 2019
1 parent 5e8b98b commit 7c93d3c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.ts
Expand Up @@ -109,8 +109,8 @@ OpenApiMiddleware.prototype.middleware = function() {
return (req, res, next) => {
const { path: rpath, method, route } = req;
var path = Array.isArray(route.path)
? route.path.find(() => rpath) || req.path
: route.path || rpath || req.path;
? route.path.find(r => r === rpath)
: route.path || rpath;
if (path && method) {
// TODO add option to enable undocumented routes to pass through without 404
const documentedRoute = this.routeMap[path];
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "express-middleware-openapi",
"version": "0.1.20-alpha",
"version": "0.1.21-alpha",
"description": "",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit 7c93d3c

Please sign in to comment.