File tree Expand file tree Collapse file tree
core/src/main/java/org/openapitools/openapidiff/core/compare Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ public class OpenApiDiff {
4040 private OAuthFlowDiff oAuthFlowDiff ;
4141 private ExtensionsDiff extensionsDiff ;
4242 private MetadataDiff metadataDiff ;
43+ private OperationIdDiff operationIdDiff ;
4344 private final OpenAPI oldSpecOpenApi ;
4445 private final OpenAPI newSpecOpenApi ;
4546 private final OpenApiDiffOptions options ;
@@ -93,6 +94,7 @@ private void initializeFields() {
9394 this .oAuthFlowDiff = new OAuthFlowDiff (this );
9495 this .extensionsDiff = new ExtensionsDiff (this );
9596 this .metadataDiff = new MetadataDiff (this );
97+ this .operationIdDiff = new OperationIdDiff (this );
9698 this .deferredSchemaCache = new DeferredSchemaCache (this );
9799 }
98100
@@ -270,6 +272,10 @@ public MetadataDiff getMetadataDiff() {
270272 return this .metadataDiff ;
271273 }
272274
275+ public OperationIdDiff getOperationIdDiff () {
276+ return this .operationIdDiff ;
277+ }
278+
273279 public OpenAPI getOldSpecOpenApi () {
274280 return this .oldSpecOpenApi ;
275281 }
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public DeferredChanged<ChangedOperation> diff(
5353 builder
5454 .with (
5555 openApiDiff
56- .getMetadataDiff ()
56+ .getOperationIdDiff ()
5757 .diff (oldOperation .getOperationId (), newOperation .getOperationId (), context ))
5858 .ifPresent (changedOperation ::setOperationId );
5959 changedOperation .setDeprecated (
Original file line number Diff line number Diff line change 1+ package org .openapitools .openapidiff .core .compare ;
2+
3+ import static org .openapitools .openapidiff .core .utils .ChangedUtils .isChanged ;
4+
5+ import java .util .Optional ;
6+ import org .openapitools .openapidiff .core .model .DiffContext ;
7+ import org .openapitools .openapidiff .core .model .schema .ChangedOperationId ;
8+
9+ public class OperationIdDiff {
10+ private final OpenApiDiff openApiDiff ;
11+
12+ public OperationIdDiff (OpenApiDiff openApiDiff ) {
13+ this .openApiDiff = openApiDiff ;
14+ }
15+
16+ public Optional <ChangedOperationId > diff (String left , String right , DiffContext context ) {
17+ return isChanged (new ChangedOperationId (left , right , context ));
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments