Skip to content

False positive diff for array with maxItems fix #785

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
merged 2 commits into from
May 13, 2025
Merged

Conversation

DrSatyr
Copy link
Collaborator

@DrSatyr DrSatyr commented May 13, 2025

fixes #784

@DrSatyr DrSatyr requested a review from Copilot May 13, 2025 19:45
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 false positive diffs for array maxItems (and similarly for minItems) by replacing reference equality checks with proper object equality checks.

  • Replace "oldValue == newValue" with "Objects.equals(oldValue, newValue)" in both ChangedMinItems.java and ChangedMaxItems.java.
  • Add the required import for java.util.Objects to support the new equality check.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMinItems.java Uses Objects.equals for value comparison, reducing false positives.
core/src/main/java/org/openapitools/openapidiff/core/model/schema/ChangedMaxItems.java Uses Objects.equals for value comparison, ensuring consistency with minItems logic.

@DrSatyr DrSatyr merged commit 9dad5b8 into master May 13, 2025
6 checks passed
@DrSatyr DrSatyr deleted the DrSatyr/issue-784 branch May 13, 2025 19:46
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 for array with maxItems
1 participant