From 9be7ea81ccfdaa6a96ec8908fa18749fccfb1df3 Mon Sep 17 00:00:00 2001 From: Amir Hoseinian Date: Fri, 10 May 2024 17:01:28 +0200 Subject: [PATCH] refactor: improve regex for route param parsing accourding to this suggestion https://github.com/acacode/swagger-typescript-api/pull/686#issuecomment-2084927918 --- src/schema-routes/schema-routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schema-routes/schema-routes.js b/src/schema-routes/schema-routes.js index 2435e642..65a19096 100644 --- a/src/schema-routes/schema-routes.js +++ b/src/schema-routes/schema-routes.js @@ -110,7 +110,7 @@ class SchemaRoutes { originalRouteName; const pathParamMatches = (routeName || '').match( - /({[a-zA-Z]([a-zA-Z0-9-_.])*})|(:[a-zA-Z]([-_.]?[a-zA-Z0-9-_.])*:?)/g, + /({[a-zA-Z]([-_.]*[a-zA-Z0-9])*})|(:[a-zA-Z]([-_.]*[a-zA-Z0-9])*:?)/g, ); // used in case when path parameters is not declared in requestInfo.parameters ("in": "path")