Field masks treat fields in oneofs just as regular fields.
Some background discussed in slack from @rvolosatovs:
So the only reason oneof container name is part of the path is to be able to select the oneof container without knowledge of which is set. E.g. to be able to SetFields on a Message and select the Payload regardless of what the "actual" payload it is.
I was not aware of this spec point when implementing this, so I just did what made sense.
This can be changed, but we should check that we don't have a use case for selecting "either of oneofs"
Why do we need this?
Comply with the spec
What is already there? What do you see now?
Every oneof field is prefixed with the type name, for example generating field masks from:
Summary
Currently, each oneof field is prefixed with the type name. According to https://developers.google.com/protocol-buffers/docs/proto3#using-oneof
and from https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/field-mask
Some background discussed in slack from @rvolosatovs:
Why do we need this?
Comply with the spec
What is already there? What do you see now?
Every oneof field is prefixed with the type name, for example generating field masks from:
results in the following allowed field masks:
provider
,provider.test_field
andprovider.test_field2
What is missing? What do you want to see?
Just
test_field
andtest_field2
Environment
v0.3.3
How do you propose to implement this?
I guess this has something to do with these lines
Can you do this yourself and submit a Pull Request?
@rvolosatovs