Skip to content

Commit

Permalink
Fix issue #225
Browse files Browse the repository at this point in the history
  • Loading branch information
Token07 committed Mar 27, 2024
1 parent 767b51b commit 7fb62c9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ApiSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ export class Path {
// Escape slashes
regex = regex.replace(/\//g, "\\/");
// Replace each parameter with a named regex group
regex = regex.replace(/\{(.*?)\}/, (match, p2) => `(?<${p2}>[^\\/?\\s]*)`);
while (regex.match(/\{(.*?)\}/))
regex = regex.replace(/\{(.*?)\}/, (match, p2) => `(?<${p2}>[^\\/?\\s]*)`);

return XRegExp(regex);
return XRegExp(regex + "$");
}

public name: string;
Expand Down

0 comments on commit 7fb62c9

Please sign in to comment.