title: Cannot deserialize specified PropertyName in Json Result.(Survey Gizmo API)
body: <p>//Here is a copy of Json Result:</p>
  
  <p>//-----------------------the previous json result ---neglect pls------------
      {
        "result_ok": true,
        "total_count": "4",
        "page": 1,
        "total_pages": 1,
        "results_per_page": 50,
        "data": [
        {
        "id": "1",
        "contact_id": "",
        "status": "Complete",
        "is_test_data": "1",
        "datesubmitted": "2011-12-09 02:07:33",
        "[question(2)]": "Victor",
        "[question(11)]": "",
        "[question(11), question_pipe(\": "",
        "[url(\": "f299f5ef90291d40543fc731bb1fd755",
        "[variable(\": "0",
        "[variable(5)]": "10009"
        }
        ]
      }</p>
  
  <p>//-----------------------the previous json result ---neglect pls------------</p>
  
  <p>Full json context:</p>
  
  <pre><code>{"result_ok":true,"total_count":"4","page":1,"total_pages":1,"results_per_page":50,"data":[{"id":"1","contact_id":"","status":"Complete","is_test_data":"1","datesubmitted":"2011-12-09 02:07:33","[question(2)]":"Victor","[question(4), option(10001)]":"Oral Roberts","[question(4), option(10002)]":"","[question(4), option(10003)]":"Kansas St","[question(4), option(10004)]":"","[question(4), option(10005)]":"Notre Dame","[question(4), option(10007)]":"","[question(4), option(10008)]":"","[question(5)]":"Black pattern","[question(6), option(10012)]":"Logo1.gif","[question(6), option(10013)]":"Logo3.jpg","[question(6), option(10014)]":"","[question(6), option(10016)]":"","[question(8), question_pipe(\"Kobe Bryant\")]":"Man","[question(8), question_pipe(\"Miao li Jie\")]":"Woman","[question(8), question_pipe(\"Yao Min\")]":"Man","[question(9), question_pipe(\"Kobe Bryant\")]":"NBA","[question(9), question_pipe(\"Miao li Jie\")]":"WCBA","[question(9), question_pipe(\"Yao Min\")]":"NBA","[question(10), option(10024), question_pipe(\"Kobe Bryant\")]":"Average Height","[question(10), option(10025), question_pipe(\"Kobe Bryant\")]":"Muscle","[question(10), option(10026), question_pipe(\"Kobe Bryant\")]":"","[question(10), option(10027), question_pipe(\"Kobe Bryant\")]":"","[question(10), option(10025), question_pipe(\"Miao li Jie\")]":"Muscle","[question(10), option(10026), question_pipe(\"Miao li Jie\")]":"","[question(10), option(10024), question_pipe(\"Yao Min\")]":"","[question(10), option(10025), question_pipe(\"Yao Min\")]":"Muscle","[question(10), option(10027), question_pipe(\"Yao Min\")]":"","[question(11)]":"","[question(11), question_pipe(\"Kobe Bryant\")]":"","[question(11), question_pipe(\"Miao li Jie\")]":"","[question(11), question_pipe(\"Yao Min\")]":"","[question(13)]":"20-99","[question(15)]":"Furniture","[question(16), option(10044)]":"","[question(17)]":"","[question(18), option(10053)]":"","[question(18), option(10054)]":"","[question(18), option(10056)]":"KINWAI","[url(\"id\")]":"746788","[url(\"crc\")]":"f299f5ef90291d40543fc731bb1fd755","[variable(\"STANDARD_IP\")]":"","[variable(\"STANDARD_LONG\")]":"","[variable(\"STANDARD_LAT\")]":"","[variable(\"STANDARD_GEOCOUNTRY\")]":"","[variable(\"STANDARD_GEOCITY\")]":"","[variable(\"STANDARD_GEOREGION\")]":"","[variable(\"STANDARD_GEOPOSTAL\")]":"","[variable(\"STANDARD_RESPONSETIME\")]":"","[variable(\"STANDARD_COMMENTS\")]":"","[variable(\"STANDARD_GEODMA\")]":"0","[variable(5)]":"10009","[variable(8)]":"","[variable(8), question_pipe(\"Kobe Bryant\")]":"10017","[variable(8), question_pipe(\"Miao li Jie\")]":"10018","[variable(8), question_pipe(\"Yao Min\")]":"10017","[variable(9)]":"","[variable(9), question_pipe(\"Kobe Bryant\")]":"10019","[variable(9), question_pipe(\"Miao li Jie\")]":"10023","[variable(9), question_pipe(\"Yao Min\")]":"10019","[variable(13)]":"10031","[variable(15)]":"10042","[variable(17)]":""},{"id":"2","contact_id":"","status":"Partial","is_test_data":"1","datesubmitted":"2011-12-09 02:08:11","[question(2)]":"Jerry","[question(4), option(10001)]":"","[question(4), option(10002)]":"","[question(4), option(10003)]":"","[question(4), option(10004)]":"","[question(4), option(10005)]":"","[question(4), option(10007)]":"Harvard","[question(4), option(10008)]":"","[question(5)]":"Black pattern","[question(6), option(10012)]":"","[question(6), option(10013)]":"Logo3.jpg","[question(6), option(10014)]":"Logo4.jpg","[question(6), option(10016)]":"","[question(8), question_pipe(\"Kobe Bryant\")]":"Man","[question(8), question_pipe(\"Miao li Jie\")]":"Woman","[question(8), question_pipe(\"Yao Min\")]":"Man","[question(9), question_pipe(\"Kobe Bryant\")]":"NBA","[question(9), question_pipe(\"Miao li Jie\")]":"WCBA","[question(9), question_pipe(\"Yao Min\")]":"CBA","[question(10), option(10024), question_pipe(\"Kobe Bryant\")]":"","[question(10), option(10025), question_pipe(\"Kobe Bryant\")]":"","[question(10), option(10026), question_pipe(\"Kobe Bryant\")]":"","[question(10), option(10027), question_pipe(\"Kobe Bryant\")]":"","[question(10), option(10025), question_pipe(\"Miao li Jie\")]":"","[question(10), option(10026), question_pipe(\"Miao li Jie\")]":"","[question(10), option(10024), question_pipe(\"Yao Min\")]":"","[question(10), option(10025), question_pipe(\"Yao Min\")]":"","[question(10), option(10027), question_pipe(\"Yao Min\")]":"","[question(11)]":"","[question(11), question_pipe(\"Kobe Bryant\")]":"","[question(11), question_pipe(\"Miao li Jie\")]":"","[question(11), question_pipe(\"Yao Min\")]":"","[question(13)]":"100-499","[question(15)]":"Clothing","[question(16), option(10044)]":"","[question(17)]":"Dark","[question(18), option(10053)]":"","[question(18), option(10054)]":"","[question(18), option(10056)]":"","[url(\"id\")]":"746788","[url(\"crc\")]":"f299f5ef90291d40543fc731bb1fd755","[variable(\"STANDARD_IP\")]":"","[variable(\"STANDARD_LONG\")]":"","[variable(\"STANDARD_LAT\")]":"","[variable(\"STANDARD_GEOCOUNTRY\")]":"","[variable(\"STANDARD_GEOCITY\")]":"","[variable(\"STANDARD_GEOREGION\")]":"","[variable(\"STANDARD_GEOPOSTAL\")]":"","[variable(\"STANDARD_RESPONSETIME\")]":"","[variable(\"STANDARD_COMMENTS\")]":"","[variable(\"STANDARD_GEODMA\")]":"0","[variable(5)]":"10009","[variable(8)]":"","[variable(8), question_pipe(\"Kobe Bryant\")]":"10017","[variable(8), question_pipe(\"Miao li Jie\")]":"10018","[variable(8), question_pipe(\"Yao Min\")]":"10017","[variable(9)]":"","[variable(9), question_pipe(\"Kobe Bryant\")]":"10019","[variable(9), question_pipe(\"Miao li Jie\")]":"10023","[variable(9), question_pipe(\"Yao Min\")]":"10020","[variable(13)]":"10032","[variable(15)]":"10040","[variable(17)]":"10050"},{"id":"3","contact_id":"","status":"Complete","is_test_data":"1","datesubmitted":"2011-12-09 02:19:42","[question(2)]":"todd","[question(4), option(10001)]":"","[question(4), option(10002)]":"","[question(4), option(10003)]":"Kansas St","[question(4), option(10004)]":"West Virginia","[question(4), option(10005)]":"","[question(4), option(10007)]":"","[question(4), option(10008)]":"Connecticut","[question(5)]":"Orange pattern","[question(6), option(10012)]":"Logo1.gif","[question(6), option(10013)]":"Logo3.jpg","[question(6), option(10014)]":"","[question(6), option(10016)]":"Logo2.jpg","[question(8), question_pipe(\"Kobe Bryant\")]":"Woman","[question(8), question_pipe(\"Miao li Jie\")]":"Woman","[question(8), question_pipe(\"Yao Min\")]":"Woman","[question(9), question_pipe(\"Kobe Bryant\")]":"ACB","[question(9), question_pipe(\"Miao li Jie\")]":"EML","[question(9), question_pipe(\"Yao Min\")]":"CBA","[question(10), option(10024), question_pipe(\"Kobe Bryant\")]":"Average Height","[question(10), option(10025), question_pipe(\"Kobe Bryant\")]":"Muscle","[question(10), option(10026), question_pipe(\"Kobe Bryant\")]":"Beard","[question(10), option(10027), question_pipe(\"Kobe Bryant\")]":"WaveHairs","[question(10), option(10025), question_pipe(\"Miao li Jie\")]":"Muscle","[question(10), option(10026), question_pipe(\"Miao li Jie\")]":"Beard","[question(10), option(10024), question_pipe(\"Yao Min\")]":"Average Height","[question(10), option(10025), question_pipe(\"Yao Min\")]":"","[question(10), option(10027), question_pipe(\"Yao Min\")]":"WaveHairs","[question(11)]":"","[question(11), question_pipe(\"Kobe Bryant\")]":"ddd","[question(11), question_pipe(\"Miao li Jie\")]":"dd","[question(11), question_pipe(\"Yao Min\")]":"ddd","[question(13)]":"10-19","[question(15)]":"Furniture","[question(16), option(10044)]":"","[question(17)]":"","[question(18), option(10053)]":"QUANU","[question(18), option(10054)]":"HUARI","[question(18), option(10056)]":"","[url(\"id\")]":"746788","[url(\"crc\")]":"f299f5ef90291d40543fc731bb1fd755","[variable(\"STANDARD_IP\")]":"","[variable(\"STANDARD_LONG\")]":"","[variable(\"STANDARD_LAT\")]":"","[variable(\"STANDARD_GEOCOUNTRY\")]":"","[variable(\"STANDARD_GEOCITY\")]":"","[variable(\"STANDARD_GEOREGION\")]":"","[variable(\"STANDARD_GEOPOSTAL\")]":"","[variable(\"STANDARD_RESPONSETIME\")]":"","[variable(\"STANDARD_COMMENTS\")]":"","[variable(\"STANDARD_GEODMA\")]":"0","[variable(5)]":"10010","[variable(8)]":"","[variable(8), question_pipe(\"Kobe Bryant\")]":"10018","[variable(8), question_pipe(\"Miao li Jie\")]":"10018","[variable(8), question_pipe(\"Yao Min\")]":"10018","[variable(9)]":"","[variable(9), question_pipe(\"Kobe Bryant\")]":"10021","[variable(9), question_pipe(\"Miao li Jie\")]":"10022","[variable(9), question_pipe(\"Yao Min\")]":"10020","[variable(13)]":"10030","[variable(15)]":"10042","[variable(17)]":""},{"id":"4","contact_id":"","status":"Partial","is_test_data":"1","datesubmitted":"2011-12-09 02:21:10","[question(2)]":"suan","[question(4), option(10001)]":"Oral Roberts","[question(4), option(10002)]":"Oklahoma","[question(4), option(10003)]":"","[question(4), option(10004)]":"","[question(4), option(10005)]":"","[question(4), option(10007)]":"","[question(4), option(10008)]":"","[question(5)]":"Red pattern","[question(6), option(10012)]":"Logo1.gif","[question(6), option(10013)]":"","[question(6), option(10014)]":"","[question(6), option(10016)]":"","[question(8), question_pipe(\"Kobe Bryant\")]":"Man","[question(8), question_pipe(\"Miao li Jie\")]":"Man","[question(8), question_pipe(\"Yao Min\")]":"Man","[question(9), question_pipe(\"Kobe Bryant\")]":"NBA","[question(9), question_pipe(\"Miao li Jie\")]":"NBA","[question(9), question_pipe(\"Yao Min\")]":"NBA","[question(10), option(10024), question_pipe(\"Kobe Bryant\")]":"","[question(10), option(10025), question_pipe(\"Kobe Bryant\")]":"Muscle","[question(10), option(10026), question_pipe(\"Kobe Bryant\")]":"","[question(10), option(10027), question_pipe(\"Kobe Bryant\")]":"WaveHairs","[question(10), option(10025), question_pipe(\"Miao li Jie\")]":"Muscle","[question(10), option(10026), question_pipe(\"Miao li Jie\")]":"","[question(10), option(10024), question_pipe(\"Yao Min\")]":"","[question(10), option(10025), question_pipe(\"Yao Min\")]":"Muscle","[question(10), option(10027), question_pipe(\"Yao Min\")]":"","[question(11)]":"","[question(11), question_pipe(\"Kobe Bryant\")]":"","[question(11), question_pipe(\"Miao li Jie\")]":"","[question(11), question_pipe(\"Yao Min\")]":"china","[question(13)]":"20-99","[question(15)]":"House-hold","[question(16), option(10044)]":"TV","[question(17)]":"","[question(18), option(10053)]":"","[question(18), option(10054)]":"","[question(18), option(10056)]":"","[url(\"id\")]":"746788","[url(\"crc\")]":"f299f5ef90291d40543fc731bb1fd755","[variable(\"STANDARD_IP\")]":"","[variable(\"STANDARD_LONG\")]":"","[variable(\"STANDARD_LAT\")]":"","[variable(\"STANDARD_GEOCOUNTRY\")]":"","[variable(\"STANDARD_GEOCITY\")]":"","[variable(\"STANDARD_GEOREGION\")]":"","[variable(\"STANDARD_GEOPOSTAL\")]":"","[variable(\"STANDARD_RESPONSETIME\")]":"","[variable(\"STANDARD_COMMENTS\")]":"","[variable(\"STANDARD_GEODMA\")]":"0","[variable(5)]":"10011","[variable(8)]":"","[variable(8), question_pipe(\"Kobe Bryant\")]":"10017","[variable(8), question_pipe(\"Miao li Jie\")]":"10017","[variable(8), question_pipe(\"Yao Min\")]":"10017","[variable(9)]":"","[variable(9), question_pipe(\"Kobe Bryant\")]":"10019","[variable(9), question_pipe(\"Miao li Jie\")]":"10019","[variable(9), question_pipe(\"Yao Min\")]":"10019","[variable(13)]":"10031","[variable(15)]":"10039","[variable(17)]":""}]}
  </code></pre>
  
  <p>I have tried entity class  :</p>
  
  <p>//Entity Class</p>
  
  <pre><code>[JsonObject(MemberSerialization.OptIn)]
  [JsonConverter(typeof(SurveryResponseConverter))]
  public class SurveyResponse
  {
      /// &lt;summary&gt;
      /// Reponse ID
      /// &lt;/summary&gt;
      [JsonConverter(typeof(CustomConverter))]
      [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "id")]
      public string id { get; set; }
  
      /// &lt;summary&gt;
      /// Contact id
      /// &lt;/summary&gt;
      [JsonConverter(typeof(CustomConverter))]
      [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "contact_id")]
      public string contact_id { get; set; }
  
      /// &lt;summary&gt;
      /// Reponse status
      /// &lt;/summary&gt;
      [JsonConverter(typeof(CustomConverter))]
      [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "status")]
      public string status { get; set; }
  
      /// &lt;summary&gt;
      /// Is test data?
      /// &lt;/summary&gt;
      [JsonConverter(typeof(CustomConverter))]
      [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "is_test_data")]
      public bool is_test_data { get; set; }
  
      /// &lt;summary&gt;
      /// when submitt the response?
      /// &lt;/summary&gt;
      [JsonConverter(typeof(CustomConverter))]
      [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "date_submitted")]
      public string date_submitted { get; set; }
  
      [JsonConverter(typeof(CustomConverter))]
      [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
      public Dictionary&lt;string, Question&gt; Questions { get; set; }
  }
  
  
  [JsonObject(MemberSerialization.OptIn)]
  public class Option
  {
      [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
      public string Key { get; set; }
  
      [JsonProperty]
      public string Value { get; set; }
  
      [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
      public Dictionary&lt;string, QuestionPipe&gt; Options { get; set; }
  }
  
  
  
  [JsonObject(MemberSerialization.OptIn)]
  public class Question
  {
      [JsonProperty(NullValueHandling = NullValueHandling.Ignore )]
      public string Key { get; set; }
  
      [JsonProperty]
      public string Value { get; set; }
  
      [JsonProperty(NullValueHandling = NullValueHandling.Ignore )]
      public Dictionary&lt;string, Option&gt; Options { get; set; }
  
      [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
      public Dictionary&lt;string, QuestionPipe&gt; QuestionPipes { get; set; }
  }
  
  
  
  [JsonObject(MemberSerialization.OptIn)]
  public class QuestionPipe
  {
      [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
      public string Key { get; set; }
  
      [JsonProperty]
      public string Value { get; set; }
  
      [JsonProperty]
      public string Answer { get; set; }
  }
  </code></pre>
  
  <p>//Converter Class</p>
  
  <pre><code>public class SurveryResponseConverter : JsonConverter
  {
      public override bool CanConvert(Type objectType)
      {
          return objectType == typeof(SurveyResponse);
      }
  
      public override bool CanRead
      {
          get { return true; }
      }
  
      public override object ReadJson(JsonReader jsonReader, Type objectType, object existingValue, JsonSerializer serializer)
      {
          var value = (SurveyResponse)existingValue;
          if (value == null)
          {
              value = new SurveyResponse();
              value.Questions = new Dictionary&lt;string, Question&gt;();
          }
  
          //string readResult = "{\n";
          while (jsonReader.Read())
          {
              if (jsonReader.TokenType == JsonToken.PropertyName)
              {
                  var name = jsonReader.Value.ToString();
  
                  if (name.StartsWith("[question("))
                  {
                      jsonReader.Read();//read the value
  
                      Regex regexQuestion = null ;//omitted for saving context
                      Regex regexQuestionAndOption = null;//omitted for saving context
                      Regex regexQuestionAndQuestionPipe =  null;//omitted for saving context
                      Regex regexQuestionAndOptionAndQuestionPipe =null;//omitted for saving context
  
                      bool isMatchQuestion, isMatchQuestionAndOption, isMatchQuestionAndPipe, isMatchQuestionAndOptionAndPipe;
                      isMatchQuestion = regexQuestion.IsMatch(name);
                      isMatchQuestionAndOption = regexQuestionAndOption.IsMatch(name);
                      isMatchQuestionAndPipe = regexQuestionAndQuestionPipe.IsMatch(name);
                      isMatchQuestionAndOptionAndPipe = regexQuestionAndOptionAndQuestionPipe.IsMatch(name);
  
                      //bool isMatchQuestionAndOption, isMatchQuestionAndPipe, isMatchQuestionAndOptionAndPipe;
                      if (isMatchQuestion)
                      {
                          //eg.[question(int)]
                          int index = int.Parse(name.Substring(10, name.IndexOf(')') - 10));
                          string strValue = serializer.Deserialize&lt;string&gt;(jsonReader);
                          Question questionValue = new Question();
                          questionValue.Key = index.ToString();
                          questionValue.Value = strValue;
                          value.Questions[index.ToString()] = questionValue;
                      }
                      else if (isMatchQuestionAndOption)
                      {
                          //eg.[question(4), option(10001)]
                          string questionKey =  name.Substring(10, name.IndexOf(')') - 10);
                          string questionOptionValue = serializer.Deserialize&lt;string&gt;(jsonReader);
                          string questionOptionKey = name.Substring(name.LastIndexOf('(')+1, name.LastIndexOf(')') - name.LastIndexOf('(')-1);
  
                          Option optionValue = new Option();
                          optionValue.Key = questionOptionKey;
                          optionValue.Value = serializer.Deserialize&lt;string&gt;(jsonReader);
                      }
                      else if (isMatchQuestionAndPipe)
                      {
                          //eg.[question(10),question_pipe(" some description of question")]
                          string questionKey = name.Substring(10, name.IndexOf(')') - 10);
                          QuestionPipe questionPipe = new QuestionPipe();
                          questionPipe.Key = "TODO";
                          questionPipe.Value = name.Substring(name.LastIndexOf('(') + 1, name.LastIndexOf(')') - name.LastIndexOf('(') - 1);
                          questionPipe.Answer = serializer.Deserialize&lt;string&gt;(jsonReader);
  
                      }
                      else if (isMatchQuestionAndOptionAndPipe)
                      {
                          //eg.[question(10), option(10024), question_pipe(" some description of question")]
                          string questionKey = name.Substring(10, name.IndexOf(')') - 10);
  
                          string subName = name.Substring(name.IndexOf('('));
                          Option optionValue = new Option();
                          optionValue.Key = subName.Substring(1, subName.IndexOf(')') - 1);
  
                          QuestionPipe questionPipe = new QuestionPipe();
                          questionPipe.Key = "TODO";
                          questionPipe.Value = name.Substring(name.LastIndexOf('(') + 1, name.LastIndexOf(')') - name.LastIndexOf('(') - 1);
                          questionPipe.Answer = serializer.Deserialize&lt;string&gt;(jsonReader);
                      }
                  }
                  else if (name.StartsWith("[variable("))
                  {
                      //TODO
                  }
                  else if (name.StartsWith("[url("))
                  {
                      //TODO
                  }
                  else
                  {
                      var property = typeof(SurveyResponse).GetProperty(name);
                      try
                      {
  </code></pre>
  
  <p><strong>//Here will be a exception : Unexpected token while deserializing object: PropertyName</strong>
                              var propertyValue = serializer.Deserialize(jsonReader, property.PropertyType);
                          }
                          catch (Exception ex)
                          {
                              string errMsg = ex.Message;
                              throw;
                          }
                      }
                  }
              }</p>
  
  <pre><code>        return value;
      }
  
      public override bool CanWrite
      {
          get { return false; }
      }
  
      public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
      {
          throw new NotImplementedException();
      }
  </code></pre>
  
  <p>Would you like give me some advice?Merry Christmas every body ^_^</p>