FYI Command line tool for Protobuf <–> JSON Conversion

91 views
Skip to first unread message

Henry Q

unread,
Apr 21, 2024, 6:08:42 PMApr 21
to prot...@googlegroups.com
Hi folks,

As far as I'm aware, there is still no official CLI tool for protobuf-json conversion.

Since I recently polished my command line ProtobufJson converter to improve useability, I'd like to share it with this list in case it's useful for others.

Here are example invocations to convert in opposite directions:
./JsonToProto -I exampleProtoSearchPath Example '{"x": 5, "text": "Hello World"}' > Output.bin
./ProtoToJson -I exampleProtoSearchPath Example < Output.bin
At my employer, we use this tool to manually make requests to proto-over-http endpoints, as well as decode gRPC requests captured by Envoy TAP.

Regards,
Henry Qin

Derek Perez

unread,
Apr 21, 2024, 6:40:47 PMApr 21
to Henry Q, prot...@googlegroups.com
Nice!

The buf cli provides a conversion tool as well:

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/CAO8bsPA9k7Sm3hytee5yy-OeRQ3AGHtwHGYm%2B9%3Dwn3QXkMX5Kg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages