google / google/built_value.dart

RFC: Implementing multiple serialization methods

Open
#1,197 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.