File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -615,8 +615,9 @@ private void postProcessOneOfModels(List<ModelMap> allModels) {
615615 for (CodegenProperty model : csOneOf ) {
616616 // Generate a valid name for the enum variant.
617617 // Mainly needed for primitive types.
618- String [] modelParts = model .dataType .replace ("<" , "Of" ).replace (">" , "" ).split ("::" );
619- model .datatypeWithEnum = camelize (modelParts [modelParts .length - 1 ]);
618+
619+ model .datatypeWithEnum = camelize (model .dataType .replaceAll ("(?:\\ w+::)+(\\ w+)" , "$1" )
620+ .replace ("<" , "Of" ).replace (">" , "" ));
620621
621622 // Primitive type is not properly set, this overrides it to guarantee adequate model generation.
622623 if (!model .getDataType ().matches (String .format (Locale .ROOT , ".*::%s" , model .getDatatypeWithEnum ()))) {
You can’t perform that action at this time.
0 commit comments