grpc-ecosystem/grpc-gateway

Inconsistent enum behaviour

Open

#354 opened on Apr 13, 2017

View on GitHub
 (1 comment) (2 reactions) (0 assignees)Go (16,971 stars) (2,250 forks)batch import
help wanted

Description

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?

Contributor guide