Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate from file descriptor #28

Open
kermit10 opened this issue Oct 5, 2016 · 5 comments
Open

Generate from file descriptor #28

kermit10 opened this issue Oct 5, 2016 · 5 comments

Comments

@kermit10
Copy link

kermit10 commented Oct 5, 2016

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

@awalterschulze
Copy link
Member

I agree, want to make a patch?

@tgulacsi
Copy link
Contributor

tgulacsi commented Nov 9, 2016

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
Copy link
Member

Its quite a lot of reimplementing work.

@emicklei
Copy link

emicklei commented Jul 5, 2017

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
Copy link
Member

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.

emicklei pushed a commit to emicklei/proto that referenced this issue Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants