forked from loafle/openapi-generator-original
#3285 ModelNamePre- and Suffixes should not be applied to Types.
This commit is contained in:
parent
6d6cfbfd5d
commit
ceffa84cdf
@ -1122,12 +1122,18 @@ public class DefaultCodegen {
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the proper model name (capitalized)
|
||||
* Output the proper model name (capitalized).
|
||||
* In case the name belongs to the TypeSystem it won't be renamed.
|
||||
*
|
||||
* @param name the name of the model
|
||||
* @return capitalized model name
|
||||
*/
|
||||
public String toModelName(final String name) {
|
||||
// Don't do any kind of renaming to language specific types
|
||||
if(typeMapping.values().contains(name)) {
|
||||
return name;
|
||||
}
|
||||
|
||||
return initialCaps(modelNamePrefix + name + modelNameSuffix);
|
||||
}
|
||||
|
||||
|
@ -343,6 +343,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
|
||||
@Override
|
||||
public String toModelName(final String name) {
|
||||
// Don't do any kind of sanitizing to Java types (e.g. BigDecimal)
|
||||
if(typeMapping.values().contains(name)) {
|
||||
return name;
|
||||
}
|
||||
|
||||
final String sanitizedName = sanitizeName(modelNamePrefix + name + modelNameSuffix);
|
||||
|
||||
// camelize the model name
|
||||
|
Loading…
x
Reference in New Issue
Block a user