dotnet-sdk
dotnet-sdk copied to clipboard
Improve AdditionalProperties equality comparison in model classes
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