I want to access etcd restfull api with cpp client. In watch request, my demo code as follow runs ok.
etcdserverpb::WatchRequest wr;
auto* create_request = wr.mutable_create_request();
create_request->set_key(watch_key);
create_request->set_range_end(range_end);
std::string output;
auto status = google::protobuf::util::MessageToJsonString(wr, &output);
but in the response stage, I just found the function JsonStringToMessage returned fail cause the structure of response string does not align to WatchResponse
::etcdserverpb::WatchResponse response;
auto status = google::protobuf::util::JsonStringToMessage(os_.to_string(), &response);
LOG(INFO) << status << " response " << response.DebugString();
the correct WatchResponse should has a field named 'result', and all content wrapped in it.
message WatchResponseEx {
WatchResponse result = 1;
}
Could such a definition be added to the proto file for convenience?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.
I want to access etcd restfull api with cpp client. In watch request, my demo code as follow runs ok.
but in the response stage, I just found the function JsonStringToMessage returned fail cause the structure of response string does not align to WatchResponse
the correct WatchResponse should has a field named 'result', and all content wrapped in it.
Could such a definition be added to the proto file for convenience?