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
https://google.aip.dev/161 proscribes that for a field of type map (e.g. map<string, string>),
we may allow field masks in requests that traverse into the map, e.g. "reviews, reviews.smith, reviews.John Smith". We use this in some places in our application.
However, we find that the FieldMask protojson implementation in go:
Rejects keys into the map that have underscores (we must camel case the keys, even though in the map we upload, the keys are in snake case). While it is expected the deserialiser converts camelCase into snake_case for ordinary keys I am surprised to see it for map keys. As a corollary, there is no way to construct a field mask that matches a map key that is not in snake_case (e.g. "MyKey").
The backtick notation (`) described in that API under "Map fields" does not work.
It seems the relevant code is here:
golang/protobuf/v2/encoding/protojson/well_known_types.go
I haven't been able to find a standards document for FieldMask in json proto to say authoritatively what it should/should not accept. Can you clarify? Are the AIPs recommending things the proto spec can't support? Is there a problem with the go protojson implementation?
Using google.golang.org/protobuf v1.36.5
The text was updated successfully, but these errors were encountered:
https://google.aip.dev/161 proscribes that for a field of type map (e.g. map<string, string>),
we may allow field masks in requests that traverse into the map, e.g. "reviews, reviews.smith, reviews.
John Smith
". We use this in some places in our application.However, we find that the FieldMask protojson implementation in go:
It seems the relevant code is here:
golang/protobuf/v2/encoding/protojson/well_known_types.go
I haven't been able to find a standards document for FieldMask in json proto to say authoritatively what it should/should not accept. Can you clarify? Are the AIPs recommending things the proto spec can't support? Is there a problem with the go protojson implementation?
Using google.golang.org/protobuf v1.36.5
The text was updated successfully, but these errors were encountered: