Skip to content

Commit 7edabde

Browse files
ahoseiniansmorimoto
authored andcommitted
refactor: improve regex for route param parsing
accourding to this suggestion #686 (comment)
1 parent cc98430 commit 7edabde

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/schema-routes/schema-routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export class SchemaRoutes {
9696
originalRouteName;
9797

9898
const pathParamMatches = (routeName || "").match(
99-
/({[a-zA-Z]([a-zA-Z0-9-_.])*})|(:[a-zA-Z]([-_.]?[a-zA-Z0-9-_.])*:?)/g,
99+
/({[a-zA-Z]([-_.]*[a-zA-Z0-9])*})|(:[a-zA-Z]([-_.]*[a-zA-Z0-9])*:?)/g,
100100
);
101101

102102
// used in case when path parameters is not declared in requestInfo.parameters ("in": "path")

0 commit comments

Comments
 (0)