You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What language does this apply to?
If it's a proto syntax change, is it for proto2 or proto3? proto3
If it's about generated code change, what programming language?
Describe the problem you are trying to solve.
Suppose you pass around configurations as protobuf messages. You want to be able to parse configurations from JSON using util::JsonStringToMessage and override a configuration with another one using MergeFrom (so that all fields in the first one which are present in the second one are overwritten). This works fine, as long as all your fields are optional and singular. But then you want to be able to override repeated fields; in particular, you want to be able to override a non-empty list of values with an empty one. To date, this is not possible, as the representations of JSONs with "a": [] for a repeated field a are indistinguishable from representations of those where the field is not present.
At first sight this seems to admit a non-invasive implementation that would depend on a bit of syntactic sugar and do not require changes to the binary format
What language does this apply to?
If it's a proto syntax change, is it for proto2 or proto3? proto3
If it's about generated code change, what programming language?
Describe the problem you are trying to solve.
Suppose you pass around configurations as protobuf messages. You want to be able to parse configurations from JSON using
util::JsonStringToMessage
and override a configuration with another one usingMergeFrom
(so that all fields in the first one which are present in the second one are overwritten). This works fine, as long as all your fields are optional and singular. But then you want to be able to overriderepeated
fields; in particular, you want to be able to override a non-empty list of values with an empty one. To date, this is not possible, as the representations of JSONs with"a": []
for a repeated fielda
are indistinguishable from representations of those where the field is not present.Describe the solution you'd like
Support
optional repeated
Describe alternatives you've considered
Wrap all
repeated
fields in something likeAdditional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: