I have a request with a field of google.protobuf.Any
type. I already checked if my gRPC service is working and I set up the envoy to transcode HTTP/JSON to gRPC. But the envoy keeps giving me an error because of the google.protobuf.Any
type.
metadata: invalid value Invalid type URL, unknown type: metadata for type Any
I constructed my request in JSON format like the one below. Is anyone know how to format google.protobuf.Any
type?
{
"type": "create",
"metadata": {
"@type": "type.googleapis.com/metadata",
"credentials": {
"username": "username",
"password": "password"
},
"context": {
"key": "value"
}
}
}
package/credentials.proto
message Credentials {
string username = 1;
string password = 2;
}
package/metadata.proto
message Metadata {
package.Credentials credentials = 1;
google.protobuf.Struct context = 2;
}
package/service.proto
message CreateOperationRequest {
string type = 1;
google.protobuf.Any metadata = 2;
}