mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-03-10 08:31:23 +00:00
fix(java): Use modelNameMappings if provided (#18025)
This commit is contained in:
@@ -870,6 +870,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
|
||||
@Override
|
||||
public String toModelName(final String name) {
|
||||
// obtain the name from modelNameMapping directly if provided
|
||||
if (modelNameMapping.containsKey(name)) {
|
||||
return modelNameMapping.get(name);
|
||||
}
|
||||
|
||||
// We need to check if schema-mapping has a different model for this class, so we use it
|
||||
// instead of the auto-generated one.
|
||||
if (schemaMapping.containsKey(name)) {
|
||||
|
||||
Reference in New Issue
Block a user