@@ -132,7 +132,7 @@ public OpenAPI parse(io.swagger.v3.oas.annotations.Operation apiOperation,
132
132
operation .setDescription (propertyResolverUtils .resolve (apiOperation .description (), locale ));
133
133
134
134
if (StringUtils .isNotBlank (apiOperation .operationId ()))
135
- operation .setOperationId (getOperationId ( apiOperation .operationId (), openAPI ));
135
+ operation .setOperationId (apiOperation .operationId ());
136
136
137
137
if (apiOperation .deprecated ())
138
138
operation .setDeprecated (apiOperation .deprecated ());
@@ -306,82 +306,6 @@ private void buildTags(io.swagger.v3.oas.annotations.Operation apiOperation, Ope
306
306
}
307
307
}
308
308
309
- /**
310
- * Gets operation id.
311
- *
312
- * @param operationId the operation id
313
- * @param openAPI the open api
314
- * @return the operation id
315
- */
316
- public String getOperationId (String operationId , OpenAPI openAPI ) {
317
- boolean operationIdUsed = existOperationId (operationId , openAPI );
318
- String operationIdToFind = null ;
319
- int counter = 0 ;
320
- while (operationIdUsed ) {
321
- operationIdToFind = String .format ("%s_%d" , operationId , ++counter );
322
- operationIdUsed = existOperationId (operationIdToFind , openAPI );
323
- }
324
- if (operationIdToFind != null ) {
325
- operationId = operationIdToFind ;
326
- }
327
- return operationId ;
328
- }
329
-
330
- /**
331
- * Exist operation id boolean.
332
- *
333
- * @param operationId the operation id
334
- * @param openAPI the open api
335
- * @return the boolean
336
- */
337
- private boolean existOperationId (String operationId , OpenAPI openAPI ) {
338
- if (openAPI == null ) {
339
- return false ;
340
- }
341
- if (openAPI .getPaths () == null || openAPI .getPaths ().isEmpty ()) {
342
- return false ;
343
- }
344
- for (PathItem path : openAPI .getPaths ().values ()) {
345
- Set <String > pathOperationIds = extractOperationIdFromPathItem (path );
346
- if (pathOperationIds .contains (operationId )) {
347
- return true ;
348
- }
349
- }
350
- return false ;
351
- }
352
-
353
- /**
354
- * Extract operation id from path item set.
355
- *
356
- * @param path the path
357
- * @return the set
358
- */
359
- private Set <String > extractOperationIdFromPathItem (PathItem path ) {
360
- Set <String > ids = new HashSet <>();
361
- if (path .getGet () != null && StringUtils .isNotBlank (path .getGet ().getOperationId ())) {
362
- ids .add (path .getGet ().getOperationId ());
363
- }
364
- if (path .getPost () != null && StringUtils .isNotBlank (path .getPost ().getOperationId ())) {
365
- ids .add (path .getPost ().getOperationId ());
366
- }
367
- if (path .getPut () != null && StringUtils .isNotBlank (path .getPut ().getOperationId ())) {
368
- ids .add (path .getPut ().getOperationId ());
369
- }
370
- if (path .getDelete () != null && StringUtils .isNotBlank (path .getDelete ().getOperationId ())) {
371
- ids .add (path .getDelete ().getOperationId ());
372
- }
373
- if (path .getOptions () != null && StringUtils .isNotBlank (path .getOptions ().getOperationId ())) {
374
- ids .add (path .getOptions ().getOperationId ());
375
- }
376
- if (path .getHead () != null && StringUtils .isNotBlank (path .getHead ().getOperationId ())) {
377
- ids .add (path .getHead ().getOperationId ());
378
- }
379
- if (path .getPatch () != null && StringUtils .isNotBlank (path .getPatch ().getOperationId ())) {
380
- ids .add (path .getPatch ().getOperationId ());
381
- }
382
- return ids ;
383
- }
384
-
385
309
/**
386
310
* Gets api responses.
387
311
*
@@ -597,21 +521,6 @@ private Optional<List<String>> getStringListFromStringArray(String[] array) {
597
521
return Optional .of (list );
598
522
}
599
523
600
- /**
601
- * Gets operation id.
602
- *
603
- * @param operationId the operation id
604
- * @param oldOperationId the old operation id
605
- * @param openAPI the open api
606
- * @return the operation id
607
- */
608
- public String getOperationId (String operationId , String oldOperationId , OpenAPI openAPI ) {
609
- if (StringUtils .isNotBlank (oldOperationId ))
610
- return this .getOperationId (oldOperationId , openAPI );
611
- else
612
- return this .getOperationId (operationId , openAPI );
613
- }
614
-
615
524
/**
616
525
* Merge operation.
617
526
*
0 commit comments