@@ -4445,21 +4445,7 @@ public CodegenOperation fromOperation(String path,
44454445
44464446 // store the original operationId for plug-in
44474447 op .operationIdOriginal = operation .getOperationId ();
4448-
4449- String operationId = getOrGenerateOperationId (operation , path , httpMethod );
4450- // remove prefix in operationId
4451- if (removeOperationIdPrefix ) {
4452- // The prefix is everything before the removeOperationIdPrefixCount occurrence of removeOperationIdPrefixDelimiter
4453- String [] components = operationId .split ("[" + removeOperationIdPrefixDelimiter + "]" );
4454- if (components .length > 1 ) {
4455- // If removeOperationIdPrefixCount is -1 or bigger that the number of occurrences, uses the last one
4456- int component_number = removeOperationIdPrefixCount == -1 ? components .length - 1 : removeOperationIdPrefixCount ;
4457- component_number = Math .min (component_number , components .length - 1 );
4458- // Reconstruct the operationId from its split elements and the delimiter
4459- operationId = String .join (removeOperationIdPrefixDelimiter , Arrays .copyOfRange (components , component_number , components .length ));
4460- }
4461- }
4462- operationId = removeNonNameElementToCamelCase (operationId );
4448+ op .operationId = getOrGenerateOperationId (operation , path , httpMethod );
44634449
44644450 if (isStrictSpecBehavior () && !path .startsWith ("/" )) {
44654451 // modifies an operation.path to strictly conform to OpenAPI Spec
@@ -4468,11 +4454,6 @@ public CodegenOperation fromOperation(String path,
44684454 op .path = path ;
44694455 }
44704456
4471- if (operationIdNameMapping .containsKey (operationId )) {
4472- op .operationId = operationIdNameMapping .get (operationId );
4473- } else {
4474- op .operationId = toOperationId (operationId );
4475- }
44764457 op .summary = escapeText (operation .getSummary ());
44774458 op .unescapedNotes = operation .getDescription ();
44784459 op .notes = escapeText (operation .getDescription ());
@@ -5599,7 +5580,26 @@ protected String getOrGenerateOperationId(Operation operation, String path, Stri
55995580 operationId = sanitizeName (builder .toString ());
56005581 LOGGER .warn ("Empty operationId found for path: {} {}. Renamed to auto-generated operationId: {}" , httpMethod , path , operationId );
56015582 }
5602- return operationId ;
5583+
5584+ // remove prefix in operationId
5585+ if (removeOperationIdPrefix ) {
5586+ // The prefix is everything before the removeOperationIdPrefixCount occurrence of removeOperationIdPrefixDelimiter
5587+ String [] components = operationId .split ("[" + removeOperationIdPrefixDelimiter + "]" );
5588+ if (components .length > 1 ) {
5589+ // If removeOperationIdPrefixCount is -1 or bigger that the number of occurrences, uses the last one
5590+ int component_number = removeOperationIdPrefixCount == -1 ? components .length - 1 : removeOperationIdPrefixCount ;
5591+ component_number = Math .min (component_number , components .length - 1 );
5592+ // Reconstruct the operationId from its split elements and the delimiter
5593+ operationId = String .join (removeOperationIdPrefixDelimiter , Arrays .copyOfRange (components , component_number , components .length ));
5594+ }
5595+ }
5596+ operationId = removeNonNameElementToCamelCase (operationId );
5597+
5598+ if (operationIdNameMapping .containsKey (operationId )) {
5599+ return operationIdNameMapping .get (operationId );
5600+ } else {
5601+ return toOperationId (operationId );
5602+ }
56035603 }
56045604
56055605 /**
0 commit comments