gogo / letmegrpc

[maintainer wanted] generates a web form gui from a grpc specification
BSD 3-Clause "New" or "Revised" License
421 stars 48 forks source link

nested enums not generating a dropdown menu #46

Closed con-ji closed 6 years ago

con-ji commented 6 years ago

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?

awalterschulze commented 6 years ago

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.

con-ji commented 6 years ago

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.

awalterschulze commented 6 years ago

That sounds like you are on the right track 😁

On Mon, 11 Jun 2018, 23:29 Jason, notifications@github.com wrote:

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

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/gogo/letmegrpc/issues/46#issuecomment-396393489, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvsLbxnqJZ9iK6mLs2SiqK5b9jkJrhSks5t7uFDgaJpZM4UZ8Gc .