grpc-ecosystem/grpc-gateway

Support mapping request body to map type

オープン

#765 opened on 2018/10/02

 (8 件のコメント) (0 件のリアクション) (0 人の担当者)Go (2,250 件のフォーク)batch import
enhancementhelp wantedwaiting on reporter

Repository metrics

Stars
 (16,971 個のスター)
PR merge metrics
 (平均マージ 8d 23h) (30d で 147 merged PRs)

説明

Is there a way tomap the message body to a keyed map? I.e. with a proto definition containing:

    rpc UpdateConfig (ServiceConfig) returns (OpResult) {
        option (google.api.http) = {
			post: "/v1/robotctl/services/configure"
			body: "config"
		};
    }

message ServiceConfig {
    ServicesReq services            = 1;
    map<string, string> config                   = 2;
}

The idea being that the body of the received message would map to a key in the, eg map<config, body_of_message>

Currently on compiling for grpc-gateway, the following error is thrown - which is odd given that there is no repeated element:

--grpc-gateway_out: repeated field not allowed in field path: config in config

コントリビューターガイド