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

impl Message for serde_json::Value #404

Open
danburkert opened this issue Dec 16, 2020 · 2 comments
Open

impl Message for serde_json::Value #404

danburkert opened this issue Dec 16, 2020 · 2 comments

Comments

@danburkert
Copy link
Collaborator

For any application utilizing both protobuf and serde, it'd be better to use serde_json::Value in place of prost_types::Value. I believe (but haven't tested) that it's possible to get prost-build to output serde_json::Value instead of prost_types::Value using prost_build::Config::extern_path(".google.protobuf.Value", "::serde_json::Value"), however ::serde_json::Value doesn't impl Message, so this won't currently work.

The solution is to add an optional serde_json dependency to prost and conditionally add the impl.

@danburkert
Copy link
Collaborator Author

and/or perhaps add reflexive From impls to convert prost_types::Value <-> serde_json::Value

@archseer
Copy link

#181 was an attempt at that.

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