Skip to content

skip_serializing_if is a footgun #1732

@khuey

Description

@khuey

skip_serializing_if only works if the serialization format is self-describing. It does not work with e.g. bincode. This is a footgun in a codebase that uses more than one serialization format at different points, because I can add skip_serializing_if to something that gets fed into the JSON serializer and it works fine, but when it gets fed into the bincode serializer it produces garbage that will fail to deserialize.

I think the solution here is for Serializers to declare whether or not they support skipping things and then make skip_serializing_if only have an effect for serializers that can tolerate it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions