google / google/built_value.dart
RFC: Implementing multiple serialization methods
- Dominant language
- Dart
- Stars
- 886
- Forks
- 195
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 4
Description
Sometimes you want to serialize a data class into multiple different data formats. The most common is JSON, but others include MessagePack, protobuf, XML, custom binary payloads, and more.
Serde (for Rust) has a list of data formats that are supported through external plugins. https://serde.rs/#data-formats
It would be nice to have some examples of how to handle serialization with built_value to multiple data formats.
I noticed we have `StandardJsonPlugin`, but it's not clear to me how we could use that and something like a MessagePackPlugin simultaneously, especially since `@BuiltValue` only supports String wire names, and it's not clear how we would input more complex information (especially in the case of binary formats). I suspect we'd have to duplicate the serializer stack and have different plugins on each one?
(I would have opened this as a discussion but I noticed it's not enabled on this repo!)
Contributor guide
Assessment
This issue has not been assessed yet.