Newer
Older
#include <util/protobuf.hh>
#include <google/protobuf/util/json_util.h>
namespace vereign {
namespace test {
auto ProtobufToJson(const google::protobuf::Message& msg) -> std::string {
std::string result;
grpc::json::Encode(msg, result, grpc::json::EncodeOptions{}.Pretty(2));
}
} // namespace vereign
} // namespace test