fix unqiue name in handling forward slash (#1839)

This commit is contained in:
William Cheng
2019-01-08 07:51:25 +08:00
committed by GitHub
parent ed5bd5ffb0
commit fbf570e7bd
2 changed files with 2 additions and 1 deletions

View File

@@ -1609,7 +1609,7 @@ public class DefaultCodegen implements CodegenConfig {
* @return capitalized model name
*/
public String toModelName(final String name) {
return initialCaps(modelNamePrefix + name + modelNameSuffix);
return initialCaps(modelNamePrefix + "_" + name + "_" + modelNameSuffix);
}
/**

View File

@@ -420,6 +420,7 @@ public class InlineModelResolver {
}
int count = 0;
boolean done = false;
key = key.replaceAll("/", "_"); // e.g. /me/videos => _me_videos
key = key.replaceAll("[^a-z_\\.A-Z0-9 ]", ""); // FIXME: a parameter
// should not be assigned. Also declare the methods parameters as 'final'.
while (!done) {