-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
Any explanation on unknown field? #3395
Comments
Unknown fields are fields that fields that are parsed but which are not recognized based on the schema from the .proto file. Ordinarily these come up when you have code with a newer version of the schema talking to code with an older version. In proto2 these unknown fields are preserved when the message is serialized, so that for example you can parse a message and reserialize it without disturbing any unknown fields. In proto3 we originally removed this behavior, so that unknown fields were dropped at parsing time. However, we have since reversed that decision and we're now working on updating proto3 so that it has the same behavior as proto2, and preserves unknowns. |
@acozzette Is the older behavior in place with proto3? Can we inject the unknown fields in a |
Proto3 now preserves unknowns again, so they will be retained after a serialize-parse trip. |
I am relatively newbie in google protocol buffers. I was reading various differences between proto2 and proto3. One difference that I found was the removal of unknown fields from proto3 syntax. Any help to understand the usage of 'unknown fields' in proto2 better will be greatly appreciated.
Thank You.
The text was updated successfully, but these errors were encountered: