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
v3rpc/grpc: Failed to decode request: json: cannot unmarshal object into Go value of type etcdserverpb.isWatchRequest_RequestUnion "{"RequestUnion":{"CreateRequest":{"key":"YWJj"}}}" <nil>
Naturally, I try the value from Encode(protoReq), foolishly expecting Decode(Encode(x)) to work:
curl -L http://localhost:2379/v3alpha/watch -X POST -d '{"request_union": {"create_request": {"key": "Zm9v"}}}}'
I tried to tag the WatchRequest manually, like:
typeWatchRequeststruct {
// request_union is a request to either create a new watcher or cancel an existing watcher.//// Types that are valid to be assigned to RequestUnion:// *WatchRequest_CreateRequest// *WatchRequest_CancelRequestRequestUnionisWatchRequest_RequestUnion`protobuf:"varint,3,opt,name=request_union,proto3" json:"request_union,omitempty protobuf_oneof:"request_union""`
}
(via #etcd)
Try:
but get:
I attempted to figure out the correct syntax via encoding with grpc-gateway:
Getting a potential JSON encoding back:
Naturally, I try the value from
Encode(protoReq)
, foolishly expectingDecode(Encode(x))
to work:but still an error:
The text was updated successfully, but these errors were encountered: