mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-17 00:21:19 +00:00
updated camelize function for #567
This commit is contained in:
@@ -1099,6 +1099,21 @@ public class DefaultCodegen {
|
||||
m = p.matcher(word);
|
||||
}
|
||||
|
||||
// case out dots
|
||||
String[] parts = word.split("\\.");
|
||||
StringBuilder f = new StringBuilder();
|
||||
for(String z : parts) {
|
||||
if(z.length() > 0)
|
||||
f.append(Character.toUpperCase(z.charAt(0))).append(z.substring(1));
|
||||
}
|
||||
word = f.toString();
|
||||
|
||||
m = p.matcher(word);
|
||||
while (m.find()) {
|
||||
word = m.replaceFirst("" + Character.toUpperCase(m.group(1).charAt(0)) + m.group(1).substring(1)/*.toUpperCase()*/);
|
||||
m = p.matcher(word);
|
||||
}
|
||||
|
||||
// Uppercase the class name.
|
||||
p = Pattern.compile("(\\.?)(\\w)([^\\.]*)$");
|
||||
m = p.matcher(word);
|
||||
|
||||
Reference in New Issue
Block a user