I have added an extension post to the post and I need to marshal it as json. However, the field name for the extension message is [message.extension_message_name].
I would prefer it to be called simply extension_message_name, without curly braces and prefix, as this extension message exists elsewhere in our API, and the presence of this strange name adds to the confusion.
As far as I can tell, the person in charge of the code is in protobuf / jsonpb , where the JSONName is set to fmt.Sprintf("[%s]", desc.Nameand cannot seem to be overwritten.
Does anyone have a workaround for this?
source
share