-
Notifications
You must be signed in to change notification settings - Fork 16
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
support serialization to/from human-readable, text-based format #71
Comments
I've never seen this form of serialization before, it's not mentioned in the docs that I've read. Do analogues exist for other first-party implementations? |
well it's mentioned and described in the above links [including official docs] at least proto->string direction should be easy. there are 2 apis for this direction: and only one for other direction |
eg: this type of file is common: |
@msoucy ping on this; if it's not on your roadmap, would you have any pointers to get started? |
It's not on my roadmap... when I started dproto the format didn't even exist. The main printing code would probably be added to the mixin in |
standard text format is actually good but could be better, I propose the following, which handles repeated fields differently in a more json-like way by only putting the name of a repeated field once (or 0) instead of once per repeated element
instead of:
Essentially, this is more DRY. |
IIRC i have used a workaround based on using |
http://stackoverflow.com/questions/18873924/what-does-the-protobuf-text-format-look-like
ref: https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.text_format#TextFormat.Parser.WriteLocationsTo.details
I only see json and binary serialization (wire format)
the text format is more convenient than json and is commonly used
would be nice to have it for compatibility
The text was updated successfully, but these errors were encountered: