Skip to content

Commit

Permalink
Prevent replacing path names with the same name as a dynamic path par…
Browse files Browse the repository at this point in the history
…ameter
  • Loading branch information
Victoria-Casasampere-BeeTheData committed Feb 7, 2025
1 parent 47c0a58 commit 14a8e95
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,10 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation
String axumPath = op.path;
for (CodegenParameter param : op.pathParams) {
// Replace {baseName} with {paramName} for format string
axumPath = axumPath.replace(param.baseName, param.paramName);
String paramSearch = "{" + param.baseName + "}";
String paramReplace = "{" + param.paramName + "}";

axumPath = axumPath.replace(paramSearch, paramReplace);
}
pathMethodOpMap
.computeIfAbsent(axumPath, (key) -> new ArrayList<>())
Expand Down

0 comments on commit 14a8e95

Please sign in to comment.