Description
Hey, in order to debug something in our logic, we had to kind of replicate the logic in Shape.equals
(and in the subclasses). We are using ModelDiff
, which provides with some basic diff information, but we needed to debug things a bit more. What we ended up doing was partially replicating Shape.equals
but returning a data structure that would tell us what was the reason why the shapes are not considered equal.
For example, if the reason shape1.equals(shape2)
returns false is a trait addition and a trait modification, then we would return (in Scala) something like List(Diffs.TraitsChanged(removed=List.empty, added = List(Trait(shapeId= ..., value = ...)), modified = List(TraitModified(valueBefore = ..., valueAfter = ...))))
.
We were wondering if Smithy could have this logic instead, as we don’t want to risk replicating and diverging from this. I think this could be a new field in ChangedShape
describing the difference. Let us know what you think