starwing / lua-protobuf

A Lua module to work with Google protobuf
MIT License
1.71k stars 388 forks source link

The struct type is not supported #236

Open gaoxingliang opened 1 year ago

gaoxingliang commented 1 year ago

In the apisix grpc-transcode plugin, I found the protobuf.Struct is not supported.

https://github.com/apache/apisix/issues/8655#issuecomment-1378460282

I use the Struct to indicate a JsonObject input parameter. A message like below:

--- the request part
message RawRequest {
  google.protobuf.Struct reqdata = 1;
  string type = 2;
  string serviceurl = 3;
  string source = 4;
  int32 page = 5;
  int32 size = 6;
}

while when decoding, the reqdata is empty (not null)

Can I workaround this?

starwing commented 1 year ago

you could use hooks to manipulate the google well-known types yourself.