New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Postcard does not handle serde attribute skip_serializing_if properly #122
Comments
In general, postcard does not handle many of serde's attributes that only apply to self describing formats. See also #29. Docs PRs welcome that make this more clear. |
@jamesmunns thanks for your comments, and I kinda agree that postcard may not support all attributes, that's fine. But is there anything postcard can do to ensure the consistency of the behaviour between its own serialization and the deserialization? |
I just hit the same problem. And it's much worse if the same type needs to be serializes/deserialized with postcard and some other serializer - json, cbor, ... Then it may be not possible to just adjust serde attributes to the postcard's taste, because it would break formatting for other serializer (that i.e. must fullfil some json schema). |
I am not aware of any way to statically "notice" that round-trips will fail if you use any of the relevant serde attributes, nor am I aware of any way of preventing it in the first place. If you find a way, I am very interested! |
I've opened #125 to track this, please feel free to discuss there if you have potential solutions or ideas. |
This fails, and if I remove the
skip_serializing_if
attributes from the fields, then it works.The text was updated successfully, but these errors were encountered: