grpc-ecosystem/grpc-gateway

Inconsistent enum behaviour

オープン

#354 opened on 2017/04/13

 (1 件のコメント) (2 件のリアクション) (0 人の担当者)Go (2,250 件のフォーク)batch import
help wanted

Repository metrics

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

説明

Given the following messages and enumeration:

message NameCheckResponse {
    Result result = 1;
}

message MultiNameCheckResponse {
    map<string, Result> results = 1;
}

enum Result {
    AVAILABLE = 0;
    UNAVAILABLE = 1;
    UNKOWN = 2;
}

The returned value in case of the first message is the name of the enum. In the second case, it's the numeric value.

Is this behaviour intended?

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