Skip to content

Investigate helper support for less strict equality support #773

@thomasvl

Description

@thomasvl

We need support for Equatable/Hashable, so we have to bake in a definition, but looking at google/protobuf's language support C++ (and maybe Java) provide some interesting api to allow less strict handing around comparisons. Once the library and/or Swift it self has more support for reflection, it might make sense to provide something inspired by google/protof's src/google/protobuf/util/field_comparator.h and src/google/protobuf/util/message_differencer.h.

In addition to being able to tweak handing of float/double comparisons, default vs. explicit values, it could provide a way to control a subset of fields to compare. This last part would be a way to handle something like timestamps for last modification where that value doesn't really matter, just the values of the fields themselves; or for performance improvements, where a message might have a record/revision id, and comparing that is all that is needed to see if things are equal instead of an exhaustive comparison of fields.

Anyway, this is to look at adding apis like the upstream field_comparator and message_differencer, but expose them in a Swifty way for folks that needs customizable comparison of messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementImprovements to existing feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions