Enrich ModelDiff
with a data structure describing shape differences
#2158
Labels
feature-request
A feature should be added or improved.
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 usingModelDiff
, which provides with some basic diff information, but we needed to debug things a bit more. What we ended up doing was partially replicatingShape.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 likeList(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 thinkThe text was updated successfully, but these errors were encountered: