scala-play-server: fix enum names for reserved words (#3080)

This commit is contained in:
Adi Gerber 2019-06-05 21:26:22 +03:00 committed by Jim Schubert
parent e68426fda9
commit 0d701b7ce9

View File

@ -358,7 +358,15 @@ public class ScalaPlayFrameworkServerCodegen extends AbstractScalaCodegen implem
@Override
public String toEnumName(CodegenProperty property) {
return camelize(property.name);
return camelizeStripReservedEscape(property.name);
}
public String camelizeStripReservedEscape(String str) {
if (str.startsWith("`") && str.endsWith("`")) {
str = str.substring(1, str.length() - 1);
}
return camelize(str);
}
@Override