Skip to content

fix: No change if same minItems or maxItems #780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

danilofuchs
Copy link
Contributor

Closes #779

Handling equal minItems or maxItems

Fixes this missing detail from #753

Note:
The original PR considered that adding minItems or maxItems is a compatible change. I'm not sure I agree, but I added tests just in case

@DrSatyr DrSatyr requested review from Copilot and DrSatyr May 11, 2025 18:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@DrSatyr DrSatyr merged commit 991418b into OpenAPITools:master May 11, 2025
6 checks passed
@DrSatyr
Copy link
Collaborator

DrSatyr commented May 11, 2025

@danilofuchs Thanks for your contribution!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive diff if array has minItems
2 participants