Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

availability of 'well known types' in proto3 protocol-buffers

I see that StringValue is the message wrapper for a string message, which I attempt to use in:

service SomeService {
  // health
  rpc HealthCheck(google.protobuf.Empty)
    returns (google.protobuf.Empty) {}
  // create
  rpc CreateSomething(SomeMessageType)
    returns (StringValue) {}

}

However, I get a message from protoc like:

somefile.proto:30:14: "StringValue" is not defined.

I'm using proto3 syntax. What am I missing?

like image 462
mohawkTrail Avatar asked Feb 05 '23 10:02

mohawkTrail


1 Answers

OK.

I needed:import "google/protobuf/wrappers.proto";

and, to use the fully qualified google.protobuf.StringValue

like image 88
mohawkTrail Avatar answered Feb 12 '23 08:02

mohawkTrail