-
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
Add opt-in support for unknown fields #574
base: master
Are you sure you want to change the base?
Add opt-in support for unknown fields #574
Conversation
I just noticed there was a previous, quite similar attempt at this in #117 . This is PR is a bit more conservative in that it doesn't change any existing messages, e.g. those in |
Reopening this since I noticed unknown fields were mentioned in #624 . I don't personally need this functionality any more but hopefully it can be useful as a starting point |
84af640
to
4d217f8
Compare
Would like to revive this topic, just wanted to know what is missing here and how we can help with it. Q: Why not having unknown fields by default instead enabling them one by one ? |
Adds a new option to prost-build:
which adds an extra field to the generated code:
When decoding the message, unknown fields are added to the new field.
The API of UnknownFieldSet is fairly minimal at the moment, it is mostly intended to allow roundtripping the fields
Closes #2