HackerTrans
TopNewTrendsCommentsPastAskShowJobs

sudorandom

39 karmajoined il y a 14 ans
https://kmcd.dev

[ my public key: https://keybase.io/sudorandom; my proof: https://keybase.io/sudorandom/sigs/lhEkaUpV37r7QzVea_cLcElODrYrTIMZezP1qIJjCro ]

comments

sudorandom
·hier·discuss
The buf CLI can do this.

Here's how it looks to convert from encoded protobuf to json (protojson).

  buf convert schema.proto \
    --type YourMessageName \
    --from payload.binpb \
    --to output.json
And just invert the arguments to convert back.

  buf convert schema.proto \
    --type YourMessageName \
    --from data.json \
    --to encoded.binpb