Skip to content
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

Better serde support for Enumerations #1087

Open
benj2468 opened this issue Jun 18, 2024 · 1 comment
Open

Better serde support for Enumerations #1087

benj2468 opened this issue Jun 18, 2024 · 1 comment

Comments

@benj2468
Copy link

Currently, if a message has a field that is an enumeration, the field is provided as an i32 and tagged with something like the following:

#[prost(enumeration = "ENUMTYPE" tag = "1")]
field: i32,

This makes deserializing using serde difficult, as the field is type i32, but the standard for serializing proto to JSON is to the use name of the proto.

Has anyone encountered this before, or is there any incentive to make this easier in prost_build?

@cynecx
Copy link

cynecx commented Jul 4, 2024

cc #1081 (That PR implements proper proto-json support which will likely address this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants