From 542ce8add94aa173530ea75852adeebc404e2c5a Mon Sep 17 00:00:00 2001 From: Carmine DiMascio Date: Thu, 21 Mar 2019 21:38:43 -0400 Subject: [PATCH] handle multi routes --- index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 2d65db5d..b17fc729 100644 --- a/index.ts +++ b/index.ts @@ -88,7 +88,9 @@ OpenApiMiddleware.prototype.install = function(app: ExpressApp) { OpenApiMiddleware.prototype.middleware = function() { return (req, res, next) => { const { path: rpath, method, route } = req; - const path = route.path || rpath; + var path = Array.isArray(route.path) + ? route.path.find(() => rpath) + : route.path || rpath; if (path && method) { // TODO add option to enable undocumented routes to pass through without 404 const documentedRoute = this.routeMap[path];