]
Adrian Nistor updated IPROTO-34:
--------------------------------
Status: Open (was: New)
Protobuf/Json mapping generates invalid json
--------------------------------------------
Key: IPROTO-34
URL:
https://issues.jboss.org/browse/IPROTO-34
Project: Infinispan ProtoStream
Issue Type: Bug
Affects Versions: 4.0.0.Alpha5
Reporter: Gustavo Fernandes
Assignee: Gustavo Fernandes
A json containing a string field value with the '\n', when converted to protobuf
and back results in invalid json with line breaks.
The following escaping should be done:
{noformat}
REPLACEMENT_CHARS['"'] = "\\\"";
REPLACEMENT_CHARS['\\'] = "\\\\";
REPLACEMENT_CHARS['\t'] = "\\t";
REPLACEMENT_CHARS['\b'] = "\\b";
REPLACEMENT_CHARS['\n'] = "\\n";
REPLACEMENT_CHARS['\r'] = "\\r";
REPLACEMENT_CHARS['\f'] = "\\f";
{noformat}