gRPC body messae is being altered using postman

Postman is altering the request body

I’m using postman to test a gRPC API and I’m using a nested json object like this:

"data": {
            "fields": [
                {
                    "key": "general_key",
                    "value": {
                        "struct_value": {
                            "list_keys": [
                                {
                                    "key": "key 1",
                                    "value": {
                                        "string_value": "1"
                                    }
                                }
                            ]
                        }
                    }
                }
            ]
        }

However, the server what is receiving is a wrong value for “list_keys” list. Instead of receiving a list of JSON documents (key 1, and key2), I’m getting a dictionary:

  data {
    fields {
      key: "list_keys"
      value {
        struct_value {
          fields {
            key: "0"
            value {
            }
          }
        }
      }
    }
  }

I’ve confirmed that this is happening only with Postman, with other applications, I get the correct JSON document in the backend:

document_data {
    fields {
      key: "general_key"
      value {
        list_value {
          values {
            struct_value {
              fields {
                key: "key"
                value {
                  string_value: "list_keys"
                }
              }
              fields {
                key: "value"
                value {
                  struct_value {
                    fields {
                      key: "struct_value"
                      value {
                        struct_value {
                          fields {
                            key: "fields"
                            value {
                              list_value {
                                values {
                                  struct_value {
                                    fields {
                                      key: "key"
                                      value {
                                        string_value: "key 1"
                                      }
                                    }
                                    fields {
                                      key: "value"
                                      value {
                                        struct_value {
                                          fields {
                                            key: "string_value"
                                            value {
                                              string_value: "1"
                                            }
                                          }
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }

Does anyone have an idea of why postman is altering the request body?

–Thanks

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