serde-rs / serde

Serialization framework for Rust
https://serde.rs/
Apache License 2.0
8.82k stars 748 forks source link

Feedback request: How to handle unsupported "self-describing-only" attributes #2674

Open jamesmunns opened 5 months ago

jamesmunns commented 5 months ago

Hey there,

There are a number of attributes that can be used in serde that seem to cause problems with non-self describing formats like postcard. Some issues include:

This is unfortunate, as in many cases (I don't have a comprehensive list of all affected attributes):

Is there any way you are aware of to do one of the following?

Right now my only answer is "don't do that", and I should probably add a bigger warning about it, as it is a thing that people often hit, particularly when they are using the same data formats with different wire formats (e.g. a JSON-to-postcard adapter).