letmegrpc icon indicating copy to clipboard operation
letmegrpc copied to clipboard

Generate from file descriptor

Open kermit10 opened this issue 9 years ago • 5 comments

With support for reflection in Go, it would be great if letmegrpc could supports rendering from a proto file descriptor.

kermit10 avatar Oct 05 '16 20:10 kermit10

I agree, want to make a patch?

awalterschulze avatar Oct 06 '16 05:10 awalterschulze

AFAIK you'll have to reimplement part of what protoc does: do what's in protoc-gen-letmegrpc/main.go and write out gen.Response.File-s.

tgulacsi avatar Nov 09 '16 13:11 tgulacsi

Its quite a lot of reimplementing work.

awalterschulze avatar Nov 09 '16 14:11 awalterschulze

maybe this can help here https://github.com/emicklei/proto .

Each of our services also provides an endpoint to serve the proto definition of the api ; would be nice if letmegrpc could take that URL and produce the Web form dynamically. Kind of Swagger UI for gRPC

emicklei avatar Jul 05 '17 06:07 emicklei

Yes that would definitely help. I have some questions though.

  1. Is the proto parser complete? Can it for example parse https://github.com/gogo/protobuf/blob/master/test/thetest.proto and https://github.com/gogo/protobuf/blob/master/test/theproto3/theproto3.proto

  2. I see your proto parser includes protofmt, which means you'll have to return an ast that is more descriptive than the FileDescriptorSet, because of unattached comments, which are not returned in the FileDescriptorSet, as far as I know. Can your proto parser also return a FileDescriptorSet, as this is what most standard tools are built on, or is transforming the proto ast into the FileDescriptorSet still something that needs to be done?

Even if these are still shortcomings, I still think your proto parser is by far the most complete option, currently available.

awalterschulze avatar Jul 05 '17 07:07 awalterschulze