mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 09:17:06 +00:00
scala-play-server: fix enum names for reserved words (#3080)
This commit is contained in:
@@ -358,7 +358,15 @@ public class ScalaPlayFrameworkServerCodegen extends AbstractScalaCodegen implem
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toEnumName(CodegenProperty property) {
|
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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user