You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement equality (IEquatable<T> and override object.Equals/GetHashCode) for object models #2989
I want to be able to compare two different OpenApiSchema instances for equality. I think it would make sense to implement equality on all object model types so that they implement IEquatable<T> and override object.Equals and GetHashCode methods.
I think IEquatable<T>, object.Equals and GetHashCode are the most important.
I don't feel IComparer makes a lot sense, because it's about making the decision of less than, greater than, or equal. I don't think less than and greater than are meaningful for OpenAPI object model.
IEqualityComparer<T> might not be super important unless there can be different implementations/meanings of "equality" and there will be multiple exposed implementations of it.
All of them do comparison in the end for slightly different scenarios.
If we implemented IEquitable, we could think later on about pointing IEqualityComparer to it essentially and would be left with IComparer to really implement (assuming we get customer request for any of them)
I want to be able to compare two different OpenApiSchema instances for equality. I think it would make sense to implement equality on all object model types so that they implement
IEquatable<T>and overrideobject.EqualsandGetHashCodemethods.