Open v1lev opened 2 years ago
I would like to add that the struct is also received wrong.
My proto message:
message MyMessage {
google.protobuf.Struct data = 1;
}
I take this JSON:
{
"myKey1": "myValue1",
"myKey2": "myValue2"
}
And convert it in a C++ app with ::google::protobuf::util::JsonStringToMessage
.
Having this done I expected to see in Postmane just the same JSON structure as I sent from the service. But what I get in postman is a "json of json":
{
"key": "json",
"value": {
"struct_value": {
"fields": [
{
"key": "myKey1",
"value": {
"string_value": "myValue1"
}
},
{
"key": "myKey2",
"value": {
"string_value": "myValue2"
}
}
]
}
}
}
Similar bug happened to me too, the request worked with GrpcUI, but the server got an empty map when I copy pasted the same raw JSON to postman
@aawwsed10 Can you share the type definition and JSON value (without any sensitive information)?
@aawwsed10 Can you share the type definition and JSON value (without any sensitive information)?
{ "object": { ... "attributes": {"test":"123"}, ... } }
message Object{
...
google.protobuf.Struct attributes = 12;
...
}
and using postman the server would get map[]
and with grpcui the server gets map[test:123]
Same issue Request:
{
"data": {
"action": "deposit"
},
"id": 8
}
Proto:
message UpdateTemplateRequest {
int32 id = 1;
google.protobuf.Struct data = 2;
}
Actual request data on server:
id:8 data:{}
Why you guys still didn't fixed it? It's a major bug
It happen to me too, I was using postman with gRPC to send a struct-type property into golang applications. The apps didn't receive the payload completely, especially for the struct
-type. Is there any progress on this issue?
google.protobuf.Struct
- do not work :(
More and more people are facing this problem. We like this product but we are forced to look for other alternatives - it's a pity.
Can you please tell us when you can start solving this problem?
I don't know if any of you come to this post, but currently, I managed to use the gRPC struct value with some syntax provided. Probably this issue has been solved.
here is a simple sample of how I managed to send the struct value
...
"recipient": [
"9a71327e-5ac6-46a8-8219-2e2cadeed303"
],
"payload": {"fields": {
"action_url": {
"string_value": "https://xxxx.xxxx"
},
"request_number": {
"string_value": "asdf"
}
}},
"sender": "f7e442bc-14f7-4ee0-99c9-b317a190af45",
...
the struct value is set up to the object, and there is already a syntax for it. like
it is the same as the igor-sirotin
mention before,
I faced that issue too. I've spent a lot of time debugging my code but it looks like there is an issue with Postman.
The issue is still existing at of 2023 Dec 27 with
Version 10.21.9
UI Version: 10.21.9-ui-231220-0601
Desktop Platform Version: 10.21.0 (10.21.0)
Spent hours to figure out what went wrong :(
I am facing this also, now
We are also seeing the same problem. When we use the server reflection
proto definition, everything works great. However, when we make a GRPC call while importing the proto file, it truncates the data in the fields it is sending to server. Also,server reflection
expects 'google.protobuf.Struct' in the request in a different format, while importing the proto file
expects the 'google.protobuf.Struct' in the request in a different format .
For eg: If I have message like this in the proto file:
syntax = "proto3";
import "google/protobuf/struct.proto";
message Message {
google.protobuf.Struct data = 1;
string user_id = 2;
}
For Server reflection postman is expecting this in request:
{
"data": {
"fields": [
{
"key": "email",
"value": {
"string_value": "abc@mail.com"
}
},
{
"key": "address",
"value": {
"string_value": "Delhi, India"
}
}
]
},
user_id: "test-id"
}
When I import the proto file on postman:
{
"data": {
"fields": {
"email": {
"string_value": "abc@mail.com"
},
"address": {
"stringValue":"Delhi, India"
}
}
},
user_id: "test-id"
}
The server reflection request works fine but the one I am sending while importing proto file doesn't.
Still experiencing this on July 15, 2024
Same problem here...
I am still facing this issue!
Below is what worked for me. Using server reflection. Postman Version 11.11.1
{
"my_struct_field": {
"fields": {
"my_field_name": {
"string_value": "abc"
}
}
}
}
When I use server reflection, I get this - (properties is the struct field) Postman Version 11.11.1
"properties": {
"fields": [
{
"key": "anim consequat culpa nisi aliquip",
"value": {}
},
{
"key": "nulla irure dolor laboris dolor",
"value": {}
},
{
"key": "do aliqua anim laboris cupidatat",
"value": {}
}
]
},
On using the format that @xsor-hbo provided, it worked fine for me. Thank you.
Is there an existing issue for this?
Describe the Issue
Hi! I can't figure out how to properly send google.protobuf.Struct. Whenever I add a Struct field to the message it is received just as an empty field on the server.
Server = Python application with gRPC AsyncIO API Client = Postman
Sample message definition:
Sample message that is sent via UI:
No matter of keys and values the
data
field is always empty at the server side.Steps To Reproduce
Screenshots or Videos
No response
Environment Information
Additional Context?
No response