This seems to be a bug.
A newline “\n” char in a C# string should be serialized to JSON as “\n” also, but SS.Text serializes it as "\ "
Example using SS.Text 4.0.41 and Json.NET 6.0.8.
public class Resource
{
public string Url { get; set; }
}
var resource = new Resource { Url = "hello,\nline 2" };
var jsonNet = Newtonsoft.Json.JsonConvert.SerializeObject(resource); //{"Url":"hello,\nline 2"}
var ssText = ServiceStack.Text.JsonSerializer.SerializeToString<Resource>(resource); //{"Url":"hello,\ line 2"}
The newlines are handled correctly when deserializing the correctly formed JSON.