4

Protobuf is in binary format, and it has also equivalent text format and JSON format.

protoc has --encode and --decode option to do text-binary conversion.

But is there a small tool to do JSON-binary conversion? like below:

tool --encode input.json def.proto > pb-output.bin

and

tool --decode pb-input.bin def.proto > output.json

Thanks!

3
  • Take a look at proto-convert. Commented Jul 7, 2020 at 16:01
  • Thanks @Azeem. Did you create the tool for this question, ;), since I see it's less than a day? Commented Jul 8, 2020 at 4:03
  • 1
    Well, kind of and you're welcome! :-) Not completely true, though. ;-) I wrote this plugin earlier: fluent-plugin-protobuf-http. So, I already had an idea and other POCs on how to go about it. See: protobuf-log-sample and protobuf-repeated-type-vs-any. So, your question expedited its materialization. Cheers! :-) Commented Jul 8, 2020 at 4:13

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.