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?

贡献者指南