-
Notifications
You must be signed in to change notification settings - Fork 508
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
can prost serialize/deserialize text format and json? #541
Comments
I think I would like to ask the same question... Would be nice if someone can help give some hints? :) |
As I was told by someone:
So perhaps |
I've implemented JSON serialization and deserialization in prost_reflect. It passes all the protobuf conformance tests so I'd consider it "complete", although it would be great to get some real-world testing as well. Unlike pbjson however, it doesn't support serializing existing |
So I've found this, if anyone doesn't know already: // build.rs
use std::io::Result;
fn main() -> Result<()> {
let mut prost_build = prost_build::Config::new();
prost_build
.type_attribute(".", "#[derive(serde::Serialize,serde::Deserialize)]")
.compile_protos(&["src/jzs.proto", "src/md.proto"], &["src/"])?;
Ok(())
} Then the generated code will derive serde, with json ser/de capability. |
Indeed, those I found this thing - https://github.com/fdeantoni/prost-wkt and it seems could help with those issues. I wish |
The answer to the question is: no, currently |
No description provided.
The text was updated successfully, but these errors were encountered: