mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-03-18 07:29:10 +00:00
fix unqiue name in handling forward slash (#1839)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user