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

Generate from file descriptor #28

Open kermit10 opened 8 years ago

kermit10 commented 8 years ago

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

awalterschulze commented 8 years ago

I agree, want to make a patch?

tgulacsi commented 8 years ago

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.

awalterschulze commented 8 years ago

Its quite a lot of reimplementing work.

emicklei commented 7 years ago

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

awalterschulze commented 7 years ago

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.