search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

0 answers
Q&A Specifying the JSON name for protobuf extension
Specifying the JSON name for protobuf extension
P粉248602298 2026-01-05 07:43:23 Views 106

0

I've added an extending message to a message and need to marshal it as a json. However the field name for the extension message is [message.extension_message_name].

I would prefer it to be named just extension_message_name, without the braces and prefix, since this extension message exists elsewhere in our API and and having this weird name adds confusion.

As far as I can tell the bit of code responsible is in protobuf/jsonpb, where the JSONName is set with fmt.Sprintf("[%s]", desc.Name and cannot be overwritten it seems.

Anyone have a workaround for this?

Your Answer
submit

0 answers

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use