Skip to content

Commit 9fb9a3a

Browse files
guillerecaldeMitchell3514
authored andcommitted
Change regex to support multiple params when including file path params (#1)
* Change regex to support multiple params when including URI path param * Update regex, remove unnecessary bracket
1 parent 327646e commit 9fb9a3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/framework/openapi.spec.loader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class OpenApiSpecLoader {
106106
// instead create our own syntax that is compatible with express' pathToRegex
107107
// /{path}* => /:path*)
108108
// /{path}(*) => /:path*)
109-
const pass1 = part.replace(/\/{([^\*]+)}\({0,1}(\*)\){0,1}/g, '/:$1$2');
109+
const pass1 = part.replace(/\/{([^}]+)}\({0,1}(\*)\){0,1}/g, '/:$1$2');
110110
// substitute params with express equivalent
111111
// /path/{id} => /path/:id
112112
return pass1.replace(/\{([^}]+)}/g, ':$1');

0 commit comments

Comments
 (0)