title: Unexpected initial token 'EndObject' when populating object exception deserializing abstract class
body: <p>I wrote a custom JSON converter class in json.net and cannot figure out why I am getting the following exception when I deserialize with it. </p>
  
  <blockquote>
    <p>Unexpected initial token 'EndObject' when populating object. Expected JSON object or array. Path '', line 1, position 177.</p>
  </blockquote>
  
  <p>I have other converters in my project which are modeled very similar which work without issue so I am unsure why this is being such a problem.</p>
  
  <p>Here is the object being serialized:</p>
  
  <pre><code>[JsonConverter(typeof(CreateCRMIntegrationPromptJsonConverter))]
  public abstract class CreateCRMIntegrationDirectPromptBaseBindingModel
  {
      public bool IncludeInOutput { get; set; }
      public string Label { get; set; }
      public string Value { get; set; }
      public IValidateCRMField Validator { get; set; }
      public string ValidatorType { get; set; }
      public CRMIntegrationDirectPromptType Type { get; set; }
  }
  public class CreateCRMIntegrationPromptMobilePhoneBindingModel : CreateCRMIntegrationDirectPromptBaseBindingModel
  {
      public bool FormatPhoneNumber { get; set; }
  }
  </code></pre>
  
  <p>And the converter</p>
  
  <pre><code>public class CreateCRMIntegrationPromptJsonConverter : JsonConverter
  {
      public override bool CanConvert(Type objectType)
      {
          return objectType == typeof(Models.CreateCRMIntegrationDirectPromptBaseBindingModel);
      }
  
      public override bool CanWrite { get { return false; } }
  
      public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
      {
          try
          {
              JObject jo = JObject.Load(reader);
              JsonReader jsonReader = jo.CreateReader();
              Dictionary&lt;string, string&gt; values = new Dictionary&lt;string, string&gt;(jo.ToObject&lt;IDictionary&lt;string, string&gt;&gt;(), StringComparer.CurrentCultureIgnoreCase);
              var typeValue = values["type"].ToString();
  
              Models.CRMIntegrationDirectPromptType integrationPromptType = Models.CRMIntegrationDirectPromptType.Label;
  
              if (!Enum.TryParse(typeValue, out integrationPromptType))
              {
                  integrationPromptType = Models.CRMIntegrationDirectPromptType.Label;
              }
  
              switch (integrationPromptType)
              {
                  .........
                  case Models.CRMIntegrationDirectPromptType.MobilePhone:
                      Models.CreateCRMIntegrationPromptMobilePhoneBindingModel cRMIntegrationPromptMobilePhoneReturnModel = new Models.CreateCRMIntegrationPromptMobilePhoneBindingModel();
                      serializer.Populate(reader, cRMIntegrationPromptMobilePhoneReturnModel);
                      return cRMIntegrationPromptMobilePhoneReturnModel;
                  .........
              }
  
          }
          catch(Exception ex)
          {
              Models.CreateCRMIntegrationPromptLabelBindingModel cRMIntegrationPromptLabelReturnModelDefault = new Models.CreateCRMIntegrationPromptLabelBindingModel();
              cRMIntegrationPromptLabelReturnModelDefault.IncludeInOutput = false;
              cRMIntegrationPromptLabelReturnModelDefault.Label = string.Empty;
              cRMIntegrationPromptLabelReturnModelDefault.Type = Models.CRMIntegrationDirectPromptType.Label;
              return cRMIntegrationPromptLabelReturnModelDefault;
          }
      }
  }
  </code></pre>
  
  <p>When I test with this code I can catch the exception</p>
  
  <pre><code>var obj = new CreateCRMIntegrationPromptMobilePhoneBindingModel();
  obj.IncludeInOutput = true;
  obj.FormatPhoneNumber = true;
  obj.Label = "Test";
  obj.ValidatorType = "Answer1APILib.CRMIntegration.ValidateCRMField_NonRequired";
  obj.Type = CRMIntegrationDirectPromptType.Label;
  obj.Value = "";
  var test = JsonConvert.SerializeObject(obj);
  
  var output = JsonConvert.DeserializeObject&lt;CreateCRMIntegrationDirectPromptBaseBindingModel&gt;(test);
  </code></pre>
  
  <p>Here is the JSON returned by the serialization</p>
  
  <pre><code>{  
     "FormatPhoneNumber":true,
     "IncludeInOutput":true,
     "Label":"Test",
     "Value":"",
     "Validator":null,
     "ValidatorType":"Answer1APILib.CRMIntegration.ValidateCRMField_NonRequired",
     "Type":0
  }
  </code></pre>