mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-03-10 08:31:23 +00:00
[kotlin] Add support for modelNameMappings (#18342)
This commit is contained in:
committed by
GitHub
parent
d6749f8a0e
commit
6a2ad134c6
@@ -683,6 +683,11 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
*/
|
||||
@Override
|
||||
public String toModelName(final String name) {
|
||||
// obtain the name from modelNameMapping directly if provided
|
||||
if (modelNameMapping.containsKey(name)) {
|
||||
return modelNameMapping.get(name);
|
||||
}
|
||||
|
||||
// memoization
|
||||
if (schemaKeyToModelNameCache.containsKey(name)) {
|
||||
return schemaKeyToModelNameCache.get(name);
|
||||
|
||||
Reference in New Issue
Block a user