0

I'm trying to make a request via Swagger using JSON transcoding, but I'm encountering an error when I use a repeated field parameter in my request. The error message I'm receiving is:

response

I've attached my code snippet below for reference. Can someone help me figure out what's causing this issue and provide a solution for making a request with a repeated field parameter using JSON transcoding in Swagger?

Here's my code snippet:

syntax = "proto3";

import "google/api/annotations.proto";

package greet;

service Greeter {
  rpc SayHello (HelloRequest) returns (HelloReply) {
    option (google.api.http) = {
      get: "/v1/greeter/{name}/{ids}"
    };
  }
}

message HelloRequest {
  string name = 1;
  IdsRequest ids = 2;
}

message HelloReply {
  string message = 1;
}

message IdsRequest {
  string id = 1;
}

My request:

request

Note: I am using a very simple example just to shorten the code for this question.

  • See [gRPC Transcoding](https://cloud.google.com/endpoints/docs/grpc-service-config/reference/rpc/google.api#grpc-transcoding) specifically: "The path template may refer to one or more fields in the gRPC request message, as long as each field is a non-repeated field with a **primitive (non-message)** type". `ids` is a message type in your example. – DazWilkin Feb 13 '23 at 17:05

0 Answers0