Skip to content

bug: GRPC transcode can't work with protobuf.Struct #8655

Description

@gaoxingliang

Current Behavior

Problem

The inner struct object has not been parsed correctly. and is empty when using grpc-transcode plugin.

details

I have a grpc serivce with has below definition:

--- 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;
}

and I try to send a post request in postman with below request args:

{
    "type":"7",
    "serviceurl" :"xxxx",
    "reqdata" :{
        "key":"yyyy",
        "key_type":"zzzz",
        "model":"tttt"
    },
    "source":"3"
}

and When I checking the logs, I found the reqdata object is empty (not null).

Expected Behavior

The struct object should has data.

Error Logs

No response

Steps to Reproduce

  1. Create a routing from rest to grpc with grpc transcode.
  2. and checking whether the grpc service side can receive the correct data.

Environment

apisix:3.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions