-
Notifications
You must be signed in to change notification settings - Fork 9
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 proto3 "presence" feature #49
Comments
Since this issue was created, Protobuf 3.15.0 was released. Relevant changes:
My attention was drawn to this issue when I was struggling to access an optional field in emitted Clojure code:
was becoming (= (get-in req [:grpc-params :-dryRun])
{:dryRun false}) rather than the expected (= (get-in req [:grpc-params :dryRun]) false) (h/t to @sundbry, who explained: This is a consequence of the behavior described in implementing_proto3_presence.md: "When a user adds an optional field to proto3, this is internally rewritten as a one-field oneof, for backward-compatibility with reflection-based algorithms" The leading This also comes through in the output of
Among the work needed for this issue is upgrading the version of Google's plugin.proto to a more recent definition, one that includes the In the meantime, I'll code against the synthetic oneof representation currently being generated by the plugin. |
@spencerwilson I took a crack at the first part: protojure/google.protobuf#9 |
https://github.com/protocolbuffers/protobuf/blob/v3.12.0-rc1/docs/implementing_proto3_presence.md
The text was updated successfully, but these errors were encountered: