Closed GollyTicker closed 1 year ago
Hi, thanks for your efforts to make the documentation better. We discussed this and decided to not add protocurl into Twirp or its documentation to keep the library more accessible. While protocurl simplifies the command, it also obfuscates some of the important details within the command unless the reader dives into protocurl documentation.
All right. Thanks for the transparent communication!
Hi everyone,
I want to discuss a minor suggestion in the documentation - which Is why I first created this issue instead of directly creating a pull request with the documentation changes.
This section in the documentation explains how one can send simple requests against a twirp protobuf endpoint using a combination of
curl
andprotoc
. While it works, it seems slightly cumbersome as a command line experience.To make life easier, I've created the open-source command line tool protoCURL. This CLI adds some convinience whlie enabling one to write JSON or Protobuf Text Format when interacting with a Protobuf HTTP REST endpoint.
The example from the docs
would then be written instead as
The second form is smaller and easier to work with - which is also the reason why I created the CLI. It handles the protobuf conversions while allowing one to write directly in the protobuf text format / JSON. It goes through the messages in the proto files directory and searches for the (unique) message type definitions given the paths
..HelloReq
and..HelloResp
(where..
stands for "please infer the full path for me"). You can find more examples of the CLI usage here.What do you think? Perhaps it could make sense, to add-to/replace the way of interacting with the twrip endpoints to the docs?
Disclaimer: I have not used Twirp in any project - but while looking for solutions to this problem (before creating protocurl) - I had found your documentation. Since there is a solution for this exact problem, you might be interested in integrating it.
Thanks for your attention!