title: How to handle a Json Post with different structure from what was expected in a API
body: <p>I am developing a API using OWINHost and in my controller i've got an post method that is expecting a Json. If the Json is structured properly, everything is working just fine, but i am not being able to throw an error if the structure is different.</p>
  
  <p>I thougth about instead of receive a type "SMS" as an parameter, receives a string then use Newtonsoft.Json to parse that string, if it parses incorrectly throw the error, but i am not sure if this is good pracctice.</p>
  
  <pre><code>    [HttpPost]
      public HttpResponseMessage NewMessage(HttpRequestMessage request, [FromBody] SMS sms)
      {
          // some code
  
          //return Ok if everything runs smoothly
          return request.CreateResponse(HttpStatusCode.OK);
      }
  </code></pre>
  
  <p>I need to know when the structure of the json is incorrect so i can throw an error status.</p>
  
  <pre><code>{
    "Number": "12345",
    "Content": "Test"
  }
  </code></pre>
  
  <p>This is the json structure, and this is my SMS class</p>
  
  <pre><code>public class SMS
  {
      public string Number{ get; set; }
  
      public string Content{ get; set; }
  }
  </code></pre>