Skip to main content

MarshalPbToString

Marshals a proto message using a JSON Protobuf marshaler to a string.

def MarshalPbToString(
msg: proto.Message
) - > string, error

Marshals a proto message using the jsonPb marshaler into a string. Callers use this to convert a protobuf message object into its JSON string representation.

Parameters

NameTypeDescription
msgproto.MessageThe protobuf message object to be marshaled into a string.

Returns

TypeDescription
string, errorThe JSON string representation of the protobuf message, or an error if marshaling fails.