ServiceStack/ServiceStack.Text — pull request #430 by voloda (2014-09-11 19:33:51+00:00)
Title: Fix: Allow deserialize pretty-printed JSON with type information

When testing our services we realized that a pretty-printed JSON contain __type information cannot be properly deserialized (there can be whitespaces before __type):

```c#
[TestFixture]
public class Class1
{
class MyClass : IComparable
{
public int CompareTo(object obj)
{
return 0;
}
}

[Test]
[TestCase("[{'__type':'MyTest.Class1+MyClass'}]")]
[TestCase("[{ '__type':'MyTest.Class1+MyClass'}]")]
[TestCase("[{\n'__type':'MyTest.Class1+MyClass'}]")]
[TestCase("[{\t'__type':'MyTest.Class1+MyClass'}]")]
[TestCase("[ {'__type':'MyTest.Class1+MyClass'}]")]
[TestCase("[\n{'__type':'MyTest.Class1+MyClass'}]")]
[TestCase("[\t{'__type':'MyTest.Class1+MyClass'}]")]
[TestCase("[ { '__type':'MyTest.Class1+MyClass'}]")]
[TestCase("[\n{\n'__type':'MyTest.Class1+MyClass'}]")]
[TestCase("[\t{\t'__type':'MyTest.Class1+MyClass'}]")]
[TestCase("[{'__type':'MyTest.Class1+MyClass'} ]")]
[TestCase("[{ '__type':'MyTest.Class1+MyClass'}\t]")]
[TestCase("[{\n'__type':'MyTest.Class1+MyClass'}\n]")]
[TestCase("[{\t'__type':'MyTest.Class1+MyClass' }]")]
[TestCase("[ {'__type':'MyTest.Class1+MyClass'\t}]")]
[TestCase("[\n{'__type':'MyTest.Class1+MyClass'\n}]")]
[TestCase("[\t{'__type':'MyTest.Class1+MyClass'\t}\n]")]
[TestCase("[ { '__type':'MyTest.Class1+MyClass', }]")]
[TestCase("[\n{\n'__type':'MyTest.Class1+MyClass'}]")]
[TestCase("[\t{\t'__type':'MyTest.Class1+MyClass'}]")]
public void TypeAttrInObject(string json)
{
json = json.Replace('\'', '"');
var deserDto = JsonSerializer.DeserializeFromString>(json);
Console.WriteLine(json);
Assert.IsNotNull(deserDto);
Assert.AreEqual(1, deserDto.Count);
Assert.IsNotNull(deserDto[0]);
}

}
```