neo4j/community — Issue #166: PrettyJSON adds incorrect newlines
Author: promontis
Created: 2012-01-01 21:55:05+00:00
State: open

When sending a string containing json, say "{\"test\"}", as a property while using the PrettyJSON class, the output will become:

[
{
"method":"PUT",
"to":"/node/1/properties",
"body":{
"name":"{\"test\"
}"}}]

Do note the \n WITHIN the string value, which the parser does not accept. If I replace PrettyJSON with JSONStringer (so no prettifying), the unit test works. While this is just a unit test, I suspect that the server does the same, as it does not accept my string value. I think this actually is a bug in the pretty json classes as the non-escaped linebreak is nit equivalent and I think even illegal.