title: Boolean default value in JsonFormatter web api
body: <p>I am facing a problem in setting default value of boolean in web api. </p>
  
  <p>I have the following implementation</p>
  
  <p>Model</p>
  
  <pre><code>public class StatusModel 
  {
    [Range(1, long.MaxValue, ErrorMessage = "Id is invalid or is not sent.")]
    [RegularExpression(@"^[a-zA-Z0-9'' ']+$", ErrorMessage = "Special character should not be entered")]
     public long Id { get; set; }
  
     [Required(AllowEmptyStrings = false, ErrorMessage = "IsActive is invalid or is not sent.")]
     [Range(0 , 1 , ErrorMessage="IsActive Is Sent In Value 0 or 1 Only")]
     public bool? IsActive { get; set; }
  }
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>[HttpPut]
  public string Activate([FromBody] StatusModel model)
      {
          // implementation goes here
      }
  </code></pre>
  
  <p>json formatter in <code>WebApi.Config</code></p>
  
  <pre><code> public static class WebApiConfig
  {
      public static void Register(HttpConfiguration config)
      {
          // Web API configuration and services
          // To register exception logger of IQueryable exceptions
          config.Services.Add(typeof(IExceptionLogger), new TraceExceptionLogger());
  
          // Web API routes
          config.MapHttpAttributeRoutes();
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{action}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
  
          // JSON
          config.Formatters.Remove(config.Formatters.XmlFormatter);
          //to convert date time to local
          config.Formatters.JsonFormatter.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Local;
          // JSON formatter
          config.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
      }
  }
  </code></pre>
  
  <p>The problem is each time i am trying to send boolean to my service the value is confusing for example</p>
  
  <ol>
  <li><p>If i send the following Json <code>Is Active</code> value is set to <code>true</code></p>
  
  <p>{
    "Id": 4,
    "IsActive":5
    }</p></li>
  <li><p>If i send the following Json the following error appears <code>IsActive is invalid or is not sent</code> which is correct</p>
  
  <p>{
  "Id": 4,
  "IsActive":"0"
  }</p></li>
  </ol>