dotnet-sdk icon indicating copy to clipboard operation
dotnet-sdk copied to clipboard

Improve AdditionalProperties equality comparison in model classes

Open coderabbitai[bot] opened this issue 1 month ago • 0 comments
trafficstars

Context

This issue tracks the AdditionalProperties equality comparison improvement identified in PR #122.

Description

The equality logic for AdditionalProperties in model classes has been updated to properly compare both keys and values. Previously, the implementation only verified key presence using Except, which could incorrectly consider objects equal even when values differed.

The new implementation uses All with ContainsKey and value equality checks to ensure both keys and values match.

Impact

This is a breaking change applied consistently across multiple model classes—objects that were previously considered equal (same keys, different values) will no longer be equal after this change.

References

  • PR: https://github.com/openfga/dotnet-sdk/pull/122
  • Discussion: https://github.com/openfga/dotnet-sdk/pull/122#discussion_r2389135570
  • Requested by: @rhamzeh

coderabbitai[bot] avatar Oct 01 '25 17:10 coderabbitai[bot]