Skip to content

Commit

Permalink
[erlang-client] Apply var/param name mappings (#18662) (#18859)
Browse files Browse the repository at this point in the history
Fixes #18662
  • Loading branch information
valpackett authored Jun 5, 2024
1 parent f97706d commit 0621d34
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ public String modelFileFolder() {

@Override
public String toVarName(String name) {
if (nameMapping.containsKey(name)) {
return nameMapping.get(name);
}

// replace - with _ e.g. created-at => created_at
name = sanitizeName(name.replaceAll("-", "_"));
// for reserved word or word starting with number, append _
Expand All @@ -262,6 +266,10 @@ public String toVarName(String name) {

@Override
public String toParamName(String name) {
if (parameterNameMapping.containsKey(name)) {
return parameterNameMapping.get(name);
}

return camelize(toVarName(name));
}

Expand Down

0 comments on commit 0621d34

Please sign in to comment.