grpc-ecosystem/grpc-gateway

protoc-gen-swagger: support maps in query parameters

Open

#984 opened on Aug 6, 2019

View on GitHub
 (10 comments) (0 reactions) (0 assignees)Go (2,250 forks)batch import
bughelp wantedopenapi

Repository metrics

Stars
 (16,971 stars)
PR merge metrics
 (Avg merge 8d 23h) (147 merged PRs in 30d)

Description

Hi guys, having following definition:

message Test {
    map<string, string> filters = 1;
}

service TestService {
    rpc TestRpc(Test) returns (Test) {
        option (google.api.http) = {
            get: "/test"
        };
    }
}

Which goes through swagger generator and ends up without the map being mentioend as parameters in request:

"/test": {
      "get": {
        "operationId": "TestRpc",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/offersTest"
            }
          }
        },
        "tags": [
          "TestService"
        ]
      }
    }

I thought that I can add map params to the query... but I dont think so now and I cant tell if it's a bug... KR Jirka

Contributor guide