title: Debug ServiceStack POST Request Deserialization
body: <p>I have a use case where I am posting a complex object with an array member using jQuery. E.g.:</p>
  
  <pre><code>data: {
     obj1: obj1,
     arr1: [ ... ]
  }
  </code></pre>
  
  <p>On the server I have implemented a ServiceStack service. The automatic request mapping on the server produces nulls for the request members, but if I extract the Request.GetRawBody(), and then use ServiceStack.Text.JsonSerializer.DeserializeFromString, I get what I need.</p>
  
  <p>It would be useful to debug the actual deserialization and see what is missing. Anyone know how to do this?</p>
  
  <p><strong>Examples:</strong></p>
  
  <p><strong>Pass in a flat object</strong>
  Define a simple request object with a few fields:</p>
  
  <pre><code>public class Request
  {
    public string Name { get; set; }
  }
  </code></pre>
  
  <p>Make a jQuery ajax call:</p>
  
  <pre><code>$.ajax({
    //...
    data: {
      name: 'John Doe'
    }
  });
  </code></pre>
  
  <p>The call works, the server receives the object with "John Doe" name property.</p>
  
  <p><strong>Pass object with child-object</strong></p>
  
  <pre><code>public class Request
  {
    public Caller Caller { get; set; }
  }
  
  public class Caller
  {
    public string Name { get; set; }
  }
  </code></pre>
  
  <p>Then make a call from jQuery:</p>
  
  <pre><code>$.ajax({
    // ...
    data: {
      caller: {
        name: 'John Doe'
      }
    }
  });
  </code></pre>
  
  <p>After the call, the "caller" property of the request on the service is "null", so this approach is not working.</p>
  
  <p><strong>Conclusion</strong>
  In my original assessment I was referring to an object and array combination. I guess the problem is in getting a simple sub-object to serialize/deserialize. Does this means the concept is not supported, or am I passing the object in incorrectly?</p>