Skip to content

Procedural macro to derive Serde serializer-deserializer for Prost

License

Notifications You must be signed in to change notification settings

segfault87/prost-serde-derive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prost-serde-derive

prost-serde-derive is a procedural macro to generate Serde serializers and deserializers for Prost-generated structs.

Rationale

Currently Prost does not support JSON serialization-deserialization. Although we have the almighty Serde for JSON serialization and deserialization, using serde_derive is not possible for Prost-generated structs because representation of enumerations is different between Prost structs and Protobuf-JSON format. Prost structs represent enumerations as plain integers but Protobuf-JSON represents as text identifiers so using serde_derive won't work. This procedural macro is intended to fix the issue.

Usage

In order to use, you need a Git master branch of prost-build which implements required methods for Prost enumerations for now. If you're using tonic_build, there is a fork for using Git version of prost-build.

To see it in action, see example crate.

TODO

  • Documentation
  • Unit tests

About

Procedural macro to derive Serde serializer-deserializer for Prost

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages