title: ASP.NET Core handling JSON deserialization problems
body: <p>I would like to change default behavior of invalid JSON request handling in ASP.NET Core. I have this model:</p>
  
  <pre><code>public class Model
  {
      public Guid Id { get; set; }
  }
  </code></pre>
  
  <p>And when I send this request with this body</p>
  
  <pre><code>{
   "Id": null
  }
  </code></pre>
  
  <p>It returns this error message:</p>
  
  <pre><code> "Error converting value {null} to type 'System.Guid'. Path 'Id', line 2, position 11."
  </code></pre>
  
  <p>Of course this is absolutely logical but I want Id to be set to default value (Guid.Empty) instead of failing request. I have added this json config in Startup:</p>
  
  <pre><code>services.AddMvc()
              .AddJsonOptions(options =&gt; options.SerializerSettings.Error = (a, e) =&gt;
              {
                  e.ErrorContext.Handled = true;
              })
  </code></pre>
  
  <p>Error handler is being hit however ASP.NET Core still returns failure. This in different behavior compared to ASP.NET Web API where this was possible.</p>