From 2806ce84bf5f739c2b265774ac53fd9a352deaa1 Mon Sep 17 00:00:00 2001 From: DrSatyr Date: Sat, 26 Apr 2025 11:30:54 +0000 Subject: [PATCH 1/8] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- maven-example/pom.xml | 4 ++-- maven/pom.xml | 2 +- pom.xml | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index f748f455..f2bec76a 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools.openapidiff openapi-diff-parent - 2.1.0 + 2.2.0-SNAPSHOT openapi-diff-cli diff --git a/core/pom.xml b/core/pom.xml index 85248094..ca3b59d8 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ org.openapitools.openapidiff openapi-diff-parent - 2.1.0 + 2.2.0-SNAPSHOT openapi-diff-core diff --git a/maven-example/pom.xml b/maven-example/pom.xml index 0109e216..b88b4c65 100644 --- a/maven-example/pom.xml +++ b/maven-example/pom.xml @@ -3,7 +3,7 @@ openapi-diff-parent org.openapitools.openapidiff - 2.1.0 + 2.2.0-SNAPSHOT 4.0.0 @@ -23,7 +23,7 @@ org.openapitools.openapidiff openapi-diff-maven - 2.1.0 + 2.2.0-SNAPSHOT diff --git a/maven/pom.xml b/maven/pom.xml index 669dbcc8..ff231c20 100644 --- a/maven/pom.xml +++ b/maven/pom.xml @@ -5,7 +5,7 @@ org.openapitools.openapidiff openapi-diff-parent - 2.1.0 + 2.2.0-SNAPSHOT openapi-diff-maven diff --git a/pom.xml b/pom.xml index f37146f1..1097b16e 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ org.openapitools.openapidiff openapi-diff-parent - 2.1.0 + 2.2.0-SNAPSHOT pom openapi-diff-parent @@ -54,7 +54,7 @@ scm:git:https://github.com/OpenAPITools/openapi-diff.git scm:git:https://github.com/OpenAPITools/openapi-diff.git https://github.com/OpenAPITools/openapi-diff - 2.1.0 + HEAD @@ -75,7 +75,7 @@ 1.8 UTF-8 UTF-8 - 2025-04-26T11:30:05Z + 2025-04-26T11:30:54Z github openapitools @@ -92,7 +92,7 @@ org.openapitools.openapidiff openapi-diff-core - 2.1.0 + 2.2.0-SNAPSHOT org.junit From fb5f64c2ad98a918dda2a76a8667c012af528d6d Mon Sep 17 00:00:00 2001 From: Aliaksandr Pinchuk Date: Sat, 26 Apr 2025 14:09:15 +0200 Subject: [PATCH 2/8] docs: update Maven Central badge to remove version prefixes --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index e4979c1e..019cca0b 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,7 @@ Compare two OpenAPI specifications (3.x) and render the difference to HTML plain [![Build](https://github.com/OpenAPITools/openapi-diff/workflows/Main%20Build/badge.svg)](https://github.com/OpenAPITools/openapi-diff/actions?query=branch%3Amaster+workflow%3A"Main+Build") [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=OpenAPITools_openapi-diff&metric=alert_status)](https://sonarcloud.io/dashboard?id=OpenAPITools_openapi-diff) -[![Maven Central 2.0.x](https://img.shields.io/maven-central/v/org.openapitools.openapidiff/openapi-diff-core?versionPrefix=2.0)](https://search.maven.org/artifact/org.openapitools.openapidiff/openapi-diff-core) -[![Maven Central 2.1.x](https://img.shields.io/maven-central/v/org.openapitools.openapidiff/openapi-diff-core?versionPrefix=2.1)](https://search.maven.org/artifact/org.openapitools.openapidiff/openapi-diff-core) +[![Maven Central](https://img.shields.io/maven-central/v/org.openapitools.openapidiff/openapi-diff-core)](https://search.maven.org/artifact/org.openapitools.openapidiff/openapi-diff-core) [![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/OpenAPITools/openapi-diff) [![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g) From cec12c67a77e506f6e4fdf69abdf0404e1ef66ec Mon Sep 17 00:00:00 2001 From: Aliaksandr Pinchuk Date: Sat, 26 Apr 2025 14:52:24 +0200 Subject: [PATCH 3/8] feat: add GitHub Actions workflows for manual and release Homebrew updates --- .github/workflows/homebrew-manual.yml | 19 +++++++++++++++++++ .github/workflows/homebrew-on-release.yml | 15 +++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/homebrew-manual.yml create mode 100644 .github/workflows/homebrew-on-release.yml diff --git a/.github/workflows/homebrew-manual.yml b/.github/workflows/homebrew-manual.yml new file mode 100644 index 00000000..f68471ac --- /dev/null +++ b/.github/workflows/homebrew-manual.yml @@ -0,0 +1,19 @@ +name: Manual Homebrew Update +on: + workflow_dispatch: + inputs: + releaseVersion: + description: 'Version of the existing release to update Homebrew formula for (e.g., 2.1.0)' + required: true + +jobs: + homebrew: + name: Update Homebrew Formula + runs-on: ubuntu-latest + steps: + - name: Update Homebrew Formula + uses: dawidd6/action-homebrew-bump-formula@v4 + with: + token: ${{ secrets.HOMEBREW_PR_TOKEN }} + formula: openapi-diff + tag: ${{ github.event.inputs.releaseVersion }} \ No newline at end of file diff --git a/.github/workflows/homebrew-on-release.yml b/.github/workflows/homebrew-on-release.yml new file mode 100644 index 00000000..a8c127fc --- /dev/null +++ b/.github/workflows/homebrew-on-release.yml @@ -0,0 +1,15 @@ +name: Update Homebrew Formula On Release +on: + release: + types: [released] + +jobs: + homebrew: + name: Update Homebrew Formula + runs-on: ubuntu-latest + steps: + - name: Update Homebrew Formula + uses: dawidd6/action-homebrew-bump-formula@v4 + with: + token: ${{ secrets.HOMEBREW_PR_TOKEN }} + formula: openapi-diff \ No newline at end of file From 99c17956f91c11c7bf18ecb2cebbfa4ba79d0766 Mon Sep 17 00:00:00 2001 From: Aliaksandr Pinchuk Date: Sat, 26 Apr 2025 16:26:35 +0200 Subject: [PATCH 4/8] Revert "feat: add GitHub Actions workflows for manual and release Homebrew updates" This reverts commit cec12c67a77e506f6e4fdf69abdf0404e1ef66ec. --- .github/workflows/homebrew-manual.yml | 19 ------------------- .github/workflows/homebrew-on-release.yml | 15 --------------- 2 files changed, 34 deletions(-) delete mode 100644 .github/workflows/homebrew-manual.yml delete mode 100644 .github/workflows/homebrew-on-release.yml diff --git a/.github/workflows/homebrew-manual.yml b/.github/workflows/homebrew-manual.yml deleted file mode 100644 index f68471ac..00000000 --- a/.github/workflows/homebrew-manual.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Manual Homebrew Update -on: - workflow_dispatch: - inputs: - releaseVersion: - description: 'Version of the existing release to update Homebrew formula for (e.g., 2.1.0)' - required: true - -jobs: - homebrew: - name: Update Homebrew Formula - runs-on: ubuntu-latest - steps: - - name: Update Homebrew Formula - uses: dawidd6/action-homebrew-bump-formula@v4 - with: - token: ${{ secrets.HOMEBREW_PR_TOKEN }} - formula: openapi-diff - tag: ${{ github.event.inputs.releaseVersion }} \ No newline at end of file diff --git a/.github/workflows/homebrew-on-release.yml b/.github/workflows/homebrew-on-release.yml deleted file mode 100644 index a8c127fc..00000000 --- a/.github/workflows/homebrew-on-release.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Update Homebrew Formula On Release -on: - release: - types: [released] - -jobs: - homebrew: - name: Update Homebrew Formula - runs-on: ubuntu-latest - steps: - - name: Update Homebrew Formula - uses: dawidd6/action-homebrew-bump-formula@v4 - with: - token: ${{ secrets.HOMEBREW_PR_TOKEN }} - formula: openapi-diff \ No newline at end of file From e7e024351e9c354a06c4b468e290e851b7a80e9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 13:12:40 +0200 Subject: [PATCH 5/8] build(deps): bump org.apache.commons:commons-configuration2 (#778) Bumps org.apache.commons:commons-configuration2 from 2.11.0 to 2.12.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-configuration2 dependency-version: 2.12.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1097b16e..51b7d375 100644 --- a/pom.xml +++ b/pom.xml @@ -129,7 +129,7 @@ org.apache.commons commons-configuration2 - 2.11.0 + 2.12.0 commons-cli From 991418b71ecee3c8746c2ba137a7137369c376be Mon Sep 17 00:00:00 2001 From: Danilo Campana Fuchs Date: Sun, 11 May 2025 15:30:48 -0300 Subject: [PATCH 6/8] fix: No change if same minItems or maxItems (#780) * fix: No change if same minItems or maxItems * feat: Test adding or removing property --- .../core/model/schema/ChangedMaxItems.java | 2 +- .../core/model/schema/ChangedMinItems.java | 2 +- .../openapidiff/core/SchemaDiffTest.java | 25 ++++++++++++++++++- .../schema-min-max-items-diff-1.yaml | 18 ++++++++++++- .../schema-min-max-items-diff-2.yaml | 20 +++++++++++++-- 5 files changed, 61 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMaxItems.java b/core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMaxItems.java index 1af1134b..1ef3a498 100644 --- a/core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMaxItems.java +++ b/core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMaxItems.java @@ -17,7 +17,7 @@ public ChangedMaxItems(Integer oldValue, Integer newValue, DiffContext context) @Override public DiffResult isChanged() { - if (oldValue == null && newValue == null) { + if (oldValue == newValue) { return DiffResult.NO_CHANGES; } if (oldValue == null || newValue == null) { diff --git a/core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMinItems.java b/core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMinItems.java index 7791893c..3a3d4071 100644 --- a/core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMinItems.java +++ b/core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMinItems.java @@ -17,7 +17,7 @@ public ChangedMinItems(Integer oldValue, Integer newValue, DiffContext context) @Override public DiffResult isChanged() { - if (oldValue == null && newValue == null) { + if (oldValue == newValue) { return DiffResult.NO_CHANGES; } if (oldValue == null || newValue == null) { diff --git a/core/src/test/java/org/openapitools/openapidiff/core/SchemaDiffTest.java b/core/src/test/java/org/openapitools/openapidiff/core/SchemaDiffTest.java index 8cd477ff..1f41406a 100644 --- a/core/src/test/java/org/openapitools/openapidiff/core/SchemaDiffTest.java +++ b/core/src/test/java/org/openapitools/openapidiff/core/SchemaDiffTest.java @@ -144,7 +144,7 @@ public void changeMultipleOfHandling() { assertThat(props.get("field4").getMultipleOf().getRight()).isNull(); } - @Test // issues #480 + @Test // issues #480 and #779 public void changeMinMaxItemsHandling() { ChangedOpenApi changedOpenApi = OpenApiCompare.fromLocations( @@ -158,6 +158,9 @@ public void changeMinMaxItemsHandling() { Map props = changedSchema.getChangedProperties(); assertThat(props).isNotEmpty(); + // Check no changes in minItems and maxItems + assertThat(props.get("field0")).isNull(); + // Check increasing of minItems assertThat(props.get("field1").getMinItems().isIncompatible()).isTrue(); assertThat(props.get("field1").getMinItems().getOldValue()).isEqualTo(1); @@ -177,6 +180,26 @@ public void changeMinMaxItemsHandling() { assertThat(props.get("field4").getMaxItems().isIncompatible()).isTrue(); assertThat(props.get("field4").getMaxItems().getOldValue()).isEqualTo(100); assertThat(props.get("field4").getMaxItems().getNewValue()).isEqualTo(90); + + // Check removal of minItems + assertThat(props.get("field5").getMinItems().isCompatible()).isTrue(); + assertThat(props.get("field5").getMinItems().getOldValue()).isEqualTo(1); + assertThat(props.get("field5").getMinItems().getNewValue()).isNull(); + + // Check removal of maxItems + assertThat(props.get("field5").getMaxItems().isCompatible()).isTrue(); + assertThat(props.get("field5").getMaxItems().getOldValue()).isEqualTo(100); + assertThat(props.get("field5").getMaxItems().getNewValue()).isNull(); + + // Check addition of minItems + assertThat(props.get("field6").getMinItems().isCompatible()).isTrue(); + assertThat(props.get("field6").getMinItems().getOldValue()).isNull(); + assertThat(props.get("field6").getMinItems().getNewValue()).isEqualTo(1); + + // Check addition of maxItems + assertThat(props.get("field6").getMaxItems().isCompatible()).isTrue(); + assertThat(props.get("field6").getMaxItems().getOldValue()).isNull(); + assertThat(props.get("field6").getMaxItems().getNewValue()).isEqualTo(100); } @Test // issue #482 diff --git a/core/src/test/resources/schemaDiff/schema-min-max-items-diff-1.yaml b/core/src/test/resources/schemaDiff/schema-min-max-items-diff-1.yaml index 23d84148..a7426987 100644 --- a/core/src/test/resources/schemaDiff/schema-min-max-items-diff-1.yaml +++ b/core/src/test/resources/schemaDiff/schema-min-max-items-diff-1.yaml @@ -16,6 +16,12 @@ components: TestDTO: type: object properties: + field0: + type: array + items: + type: string + minItems: 1 + maxItems: 10 field1: type: array items: @@ -33,10 +39,20 @@ components: items: type: string minItems: 1 - maxItems: 90 + maxItems: 90 field4: type: array items: type: string minItems: 1 maxItems: 100 + field5: + type: array + items: + type: string + minItems: 1 + maxItems: 100 + field6: + type: array + items: + type: string diff --git a/core/src/test/resources/schemaDiff/schema-min-max-items-diff-2.yaml b/core/src/test/resources/schemaDiff/schema-min-max-items-diff-2.yaml index 0d8e6199..5e58f573 100644 --- a/core/src/test/resources/schemaDiff/schema-min-max-items-diff-2.yaml +++ b/core/src/test/resources/schemaDiff/schema-min-max-items-diff-2.yaml @@ -16,6 +16,12 @@ components: TestDTO: type: object properties: + field0: + type: array + items: + type: string + minItems: 1 + maxItems: 10 field1: type: array items: @@ -27,16 +33,26 @@ components: items: type: string minItems: 10 - maxItems: 100 + maxItems: 100 field3: type: array items: type: string minItems: 1 - maxItems: 100 + maxItems: 100 field4: type: array items: type: string minItems: 1 maxItems: 90 + field5: + type: array + items: + type: string + field6: + type: array + items: + type: string + minItems: 1 + maxItems: 100 From ec4993fbaf8821b0bf981f3754db8134453f8231 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 10:45:59 +0200 Subject: [PATCH 7/8] build(deps): bump swagger-parser.version from 2.1.26 to 2.1.27 (#781) Bumps `swagger-parser.version` from 2.1.26 to 2.1.27. Updates `io.swagger.parser.v3:swagger-parser-v3` from 2.1.26 to 2.1.27 Updates `io.swagger.parser.v3:swagger-parser` from 2.1.26 to 2.1.27 - [Release notes](https://github.com/swagger-api/swagger-parser/releases) - [Commits](https://github.com/swagger-api/swagger-parser/compare/v2.1.26...v2.1.27) Updates `io.swagger.parser.v3:swagger-parser-v2-converter` from 2.1.26 to 2.1.27 --- updated-dependencies: - dependency-name: io.swagger.parser.v3:swagger-parser-v3 dependency-version: 2.1.27 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.swagger.parser.v3:swagger-parser dependency-version: 2.1.27 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.swagger.parser.v3:swagger-parser-v2-converter dependency-version: 2.1.27 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 51b7d375..01079398 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,7 @@ https://sonarcloud.io ${project.artifactId} - 2.1.26 + 2.1.27 2.0.17 From 4d50af1bc8970bd3e5d57cb1003f686c4e2dc038 Mon Sep 17 00:00:00 2001 From: DrSatyr Date: Mon, 12 May 2025 09:08:27 +0000 Subject: [PATCH 8/8] [maven-release-plugin] prepare release 2.1.1 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- maven-example/pom.xml | 4 ++-- maven/pom.xml | 2 +- pom.xml | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index f2bec76a..2e68fd97 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools.openapidiff openapi-diff-parent - 2.2.0-SNAPSHOT + 2.1.1 openapi-diff-cli diff --git a/core/pom.xml b/core/pom.xml index ca3b59d8..30b160eb 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ org.openapitools.openapidiff openapi-diff-parent - 2.2.0-SNAPSHOT + 2.1.1 openapi-diff-core diff --git a/maven-example/pom.xml b/maven-example/pom.xml index b88b4c65..f76f99b2 100644 --- a/maven-example/pom.xml +++ b/maven-example/pom.xml @@ -3,7 +3,7 @@ openapi-diff-parent org.openapitools.openapidiff - 2.2.0-SNAPSHOT + 2.1.1 4.0.0 @@ -23,7 +23,7 @@ org.openapitools.openapidiff openapi-diff-maven - 2.2.0-SNAPSHOT + 2.1.1 diff --git a/maven/pom.xml b/maven/pom.xml index ff231c20..271315ea 100644 --- a/maven/pom.xml +++ b/maven/pom.xml @@ -5,7 +5,7 @@ org.openapitools.openapidiff openapi-diff-parent - 2.2.0-SNAPSHOT + 2.1.1 openapi-diff-maven diff --git a/pom.xml b/pom.xml index 01079398..02531247 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ org.openapitools.openapidiff openapi-diff-parent - 2.2.0-SNAPSHOT + 2.1.1 pom openapi-diff-parent @@ -54,7 +54,7 @@ scm:git:https://github.com/OpenAPITools/openapi-diff.git scm:git:https://github.com/OpenAPITools/openapi-diff.git https://github.com/OpenAPITools/openapi-diff - HEAD + 2.1.1 @@ -75,7 +75,7 @@ 1.8 UTF-8 UTF-8 - 2025-04-26T11:30:54Z + 2025-05-12T09:07:41Z github openapitools @@ -92,7 +92,7 @@ org.openapitools.openapidiff openapi-diff-core - 2.2.0-SNAPSHOT + 2.1.1 org.junit