GRPC message with google.protobuf.Value field not working

I’m trying to construct a Postman GRPC message which has a field that is of type google.protobuf.Value to encode raw json. The protobuf looks like this:

message PayloadRequest {
    google.protobuf.Value payload = 1;
}

When I generate an example message for this in Postman, it sees that this field is a OneOf type and generates this sample message:

{
    "payload": {
        "bool_value": false,
        "list_value": {
            "values": []
        },
        "null_value": 0,
        "number_value": "Infinity",
        "string_value": "Lorem dolor minim",
        "struct_value": {
            "fields": [
                {
                    "key": "cupidatat ipsum reprehenderit commodo"
                },
                {
                    "key": "aliquip commodo"
                },
                {
                    "key": "veniam minim est sint"
                },
                {
                    "key": "mollit pariatur"
                }
            ]
        }
    }
}

The problem I’m having with this OneOf is if I omit the other fields and only include the type I’m wanting to send for any of the type it works except for struct_value. If I attempt to supply the struct_value as the OneOf value in this message I always get this error in Postman:

proto: google.protobuf.Value: none of the oneof fields is set

1 Like

Hi Frank, thanks for your post and welcome to the community. I’m going to check with the internal team about why our gRPC client behaves this way and post a response when they reply to me.

1 Like

Hi Frank,

We looked into this, and we think this might be a bug. The Protobuf well-known types are heavily used, but the JSON representation rules for Google’s well-known types are currently unsupported.

Our team will look into this further.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.