gogo / letmegrpc

[maintainer wanted] generates a web form gui from a grpc specification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nested enums not generating a dropdown menu

con-ji opened this issue · comments

commented

I have a Protobuf message with an enum defined within it, e.g.

    enum TestEnum {
        SOME_OPTION = 1;
        SOME_OTHER_OPTION = 2;
    }
    required TestEnum test_enum = 1;
    ...
}

However, the GUI generated fails to provide a dropdown menu. Instead, it shows up as text, e.g.:
screen shot 2018-06-04 at 4 39 00 pm
Is there a fix?

We have had problems with nested types before.
I am more than happy to a proper fix being contributed, but a quick fix would be to not embed the enum.

commented

I think the issue might be in protoc-gen-gogo/descriptor/helper.go in getEnum(): the inner for loop only iterates through non-nested enums and fails to check within messages for nested enums. I'll see if I can get this fixed in protoc-gen-gogo, unless someone finds a way to fix it in letmegrpc/form

Edit: JK, it's fixable in letmegrpc - I'll try to make a PR soon.