grpc-ecosystem/grpc-gateway

Inconsistent enum behaviour

Open

#354 建立於 2017年4月13日

在 GitHub 查看
 (1 留言) (2 反應) (0 負責人)Go (16,971 star) (2,250 fork)batch import
help wanted

描述

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?

貢獻者指南