Closed Ianwww closed 6 years ago
I, unfortunately, am not as expert with protos as I probably should be, but I don't believe there is a easy way to do that that doesn't involve fieldmasks which we don't currently support. That said there is some interest in implementing that in the gateway. Would you be interested in taking that sort of project on?
thanks for the response. I had to move forward and use a wrapper around a map to handle this. I'm not going to be able to work on this with my present workload.
You have to use field masks. This will be automatically supported with #671.
With this proto definition
message UpdateMessage { string id = 1; map[string]string my_map = 2; } service YourService { rpc Echo(UpdateMessage) returns (StringMessage) { option (google.api.http) = { patch: "/update" body: "*" }; } }
I'd like to send a request like
{"id":"myid","my_map":{}}
and set MyMap to an empty map.Is this possible? Currently, when this field is provided, my service thinks this field is unset(MyMap==Nil). I'm working in golang.
@ Ianwww @achew22 Use this maybe: https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/StringValue
With this proto definition
I'd like to send a request like
{"id":"myid","my_map":{}}
and set MyMap to an empty map.Is this possible? Currently, when this field is provided, my service thinks this field is unset(MyMap==Nil). I'm working in golang.