mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 19:33:55 +00:00
Merge pull request #1164 from ePaul/bugfix/1142-sanitize-api-name-for-spring-mvc
Issue #1142: sanitize api name before camelizing.
This commit is contained in:
commit
b96fdb6766
@ -163,7 +163,7 @@ public class JaxRSServerCodegen extends JavaClientCodegen implements CodegenConf
|
||||
if (name.length() == 0) {
|
||||
return "DefaultApi";
|
||||
}
|
||||
name = name.replaceAll("[^a-zA-Z0-9]+", "_");
|
||||
name = sanitizeName(name);
|
||||
return camelize(name) + "Api";
|
||||
}
|
||||
|
||||
|
@ -175,6 +175,15 @@ public class SpringMVCServerCodegen extends JavaClientCodegen implements Codegen
|
||||
return objs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toApiName(String name) {
|
||||
if (name.length() == 0) {
|
||||
return "DefaultApi";
|
||||
}
|
||||
name = sanitizeName(name);
|
||||
return camelize(name) + "Api";
|
||||
}
|
||||
|
||||
public void setConfigPackage(String configPackage) {
|
||||
this.configPackage = configPackage;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user