Giter VIP home page Giter VIP logo

Comments (4)

jhump avatar jhump commented on July 27, 2024 1

Protoparse is just a parser/compiler for source. It is up to the caller to retrieve the source (such as from a JAR or ZIP file).

So grpcurl could ostensibly handle this, examining the contents of ZIP files and providing them to protoparse. But I'm not sure that the maintainers would be very interested in this.

For now, you can work-around this by unzipping the file separately and then pointing grpcurl directly at the unzipped sources.

Another similar and newer tool that may work is the Buf CLI. It includes a buf curl sub-command that is similar to grpcurl. But you can direct it to look at a ZIP file or even remote git repo in the --schema argument.

FYI, if you look at the notice at the top of this repo's README, you'll see that protoparse is not going to be materially maintained going forward. In an upcoming v2 of this repo, it will be omitted. Instead see https://github.com/bufbuild/protocompile for a newer Go library that compiles Protobuf sources.

Good luck!

from protoreflect.

jhump avatar jhump commented on July 27, 2024 1

@tsipo, I don't think you actually need a sym-link. I think you can suffix the file name with #format=zip. See docs.

So try this:

buf curl --protocol grpc --http2-prior-knowledge --schema example-grpc.jar#format=zip

I did not know they added curl-like capabilities.

Yeah, I did that a few months ago 😄

from protoreflect.

tsipo avatar tsipo commented on July 27, 2024

Thanks a lot!

I recall seeing a demo of buf a while ago, which focused mainly on their BSR service. I did not know they added curl-like capabilities.

They cannot take a .jar file as schema (it looks to me that the file extension determines the handling and only ".zip" is zip), but that can be resolved easily, like with the following symlink (which is less of a maintenance pain than making sure the jar file and a FileDescriptorSet are in sync):

$ ln -s example-grpc.jar example-grpc.zip
$ buf curl --protocol grpc --http2-prior-knowledge --schema example-grpc.zip \
http://localhost:50001/example.ExampleService/ping
{"msg":"Success"}

from protoreflect.

tsipo avatar tsipo commented on July 27, 2024

#format=zip suffix works like magic, thanks again!

from protoreflect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.