forked from loafle/openapi-generator-original
Ensure identifiers get sanitized; Ensure model names also have the same formatting (#5098)
This commit is contained in:
@@ -231,7 +231,7 @@ public class AkkaScalaClientCodegen extends AbstractScalaCodegen implements Code
|
||||
}
|
||||
|
||||
private String formatIdentifier(String name, boolean capitalized) {
|
||||
String identifier = camelize(name, true);
|
||||
String identifier = camelize(sanitizeName(name), true);
|
||||
if (capitalized) {
|
||||
identifier = StringUtils.capitalize(identifier);
|
||||
}
|
||||
@@ -290,6 +290,11 @@ public class AkkaScalaClientCodegen extends AbstractScalaCodegen implements Code
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toModelName(final String name) {
|
||||
return formatIdentifier(name, true);
|
||||
}
|
||||
|
||||
private static abstract class CustomLambda implements Mustache.Lambda {
|
||||
@Override
|
||||
public void execute(Template.Fragment frag, Writer out) throws IOException {
|
||||
@@ -301,7 +306,6 @@ public class AkkaScalaClientCodegen extends AbstractScalaCodegen implements Code
|
||||
public abstract String formatFragment(String fragment);
|
||||
}
|
||||
|
||||
|
||||
private static class JavadocLambda extends CustomLambda {
|
||||
@Override
|
||||
public String formatFragment(String fragment) {
|
||||
|
||||
Reference in New Issue
Block a user