Given a simple Protobuf message
message MessageWithUrl {
string url_params = 1;
}
I'm doing the following:
Msg.MessageWithUrl message = Msg.MessageWithUrl
.newBuilder()
.setUrlParams("?key=value")
.build();
String json = JsonFormat.printer()
.print(message);
System.out.println(json);
My expected outcome is:
{
"urlParams": "?key=value"
}
Instead I get:
{
"urlParams": "?key\u003dvalue"
}
I understand that the printer is using Gson under the hood, but I don't know how to have it accept the Gson option of disableHtmlEscaping