Skip to content

Commit

Permalink
add negative look behind to exclude colon delimited path segments (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
sserrata authored Nov 28, 2023
1 parent bf1c31b commit a8311ca
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,7 @@ function bindCollectionToApiItems(
const method = item.request.method.toLowerCase();
const path = item.request.url
.getPath({ unresolved: true }) // unresolved returns "/:variableName" instead of "/<type>"
.replace(/:([a-z0-9-_]+)/gi, "{$1}"); // replace "/:variableName" with "/{variableName}"

.replace(/(?<![a-z0-9-_]+):([a-z0-9-_]+)/gi, "{$1}"); // replace "/:variableName" with "/{variableName}"
const apiItem = items.find((item) => {
if (item.type === "info" || item.type === "tag") {
return false;
Expand Down

0 comments on commit a8311ca

Please sign in to comment.