fix: No change if same minItems or maxItems#780
Merged
DrSatyr merged 2 commits intoOpenAPITools:masterfrom May 11, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR addresses the handling of cases where minItems or maxItems remains unchanged, ensuring no diff is reported when these values are equal. Key changes include updating test cases for minItems/maxItems behavior and modifying the diff-check logic in ChangedMinItems and ChangedMaxItems.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| core/src/test/resources/schemaDiff/schema-min-max-items-diff-2.yaml | Added schema definitions for testing unchanged and altered minItems/maxItems |
| core/src/test/resources/schemaDiff/schema-min-max-items-diff-1.yaml | Similar schema tests to verify proper diff reporting for minItems/maxItems |
| core/src/test/java/org/openapitools/openapidiff/core/SchemaDiffTest.java | Updated tests to check for no change, removal, and addition cases for minItems/maxItems |
| core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMinItems.java | Modified equality check logic for unchanged minItems |
| core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMaxItems.java | Modified equality check logic for unchanged maxItems |
core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMinItems.java
Show resolved
Hide resolved
core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMaxItems.java
Show resolved
Hide resolved
Collaborator
|
@danilofuchs Thanks for your contribution!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #779
Handling equal minItems or maxItems
Fixes this missing detail from #753
Note:
The original PR considered that adding
minItemsormaxItemsis a compatible change. I'm not sure I agree, but I added tests just in case