title: Error Deserializing JSON Object/Array using newtonsoft
body: <p>I have an json string which contains the following data</p>
  
  <pre><code>"air:FlightOptionsList": {
      "air:FlightOption": [{
              "LegRef": "hx5kk+3R2BKABGzqAAAAAA==",
              "Destination": "LHE",
              "Origin": "DXB",
              "air:Option": {
                  "Key": "hx5kk+3R2BKA/FzqAAAAAA==",
                  "TravelTime": "P0DT3H0M0S",
                  "air:BookingInfo": {
                      "BookingCode": "I",
                      "BookingCount": "7",
                      "CabinClass": "Economy",
                      "FareInfoRef": "hx5kk+3R2BKAzFzqAAAAAA==",
                      "SegmentRef": "hx5kk+3R2BKAtFzqAAAAAA=="
                  }
              }
          }, {
              "LegRef": "hx5kk+3R2BKAFGzqAAAAAA==",
              "Destination": "DXB",
              "Origin": "LHE",
              "air:Option": {
                  "Key": "hx5kk+3R2BKACGzqAAAAAA==",
                  "TravelTime": "P0DT11H30M0S",
                  "air:BookingInfo": [{
                          "BookingCode": "U",
                          "BookingCount": "7",
                          "CabinClass": "Economy",
                          "FareInfoRef": "hx5kk+3R2BKA+FzqAAAAAA==",
                          "SegmentRef": "hx5kk+3R2BKAvFzqAAAAAA=="
                      }, {
                          "BookingCode": "Y",
                          "BookingCount": "9",
                          "CabinClass": "Economy",
                          "FareInfoRef": "hx5kk+3R2BKA+FzqAAAAAA==",
                          "SegmentRef": "hx5kk+3R2BKAxFzqAAAAAA=="
                      }
                  ],
                  "air:Connection": {
                      "SegmentIndex": "0"
                  }
              }
          }
      ]
  }
  </code></pre>
  
  <p>my Class Structure is below:</p>
  
  <pre><code>public class FlightOptionsList
  {
      public List&lt;FlightOption&gt; FlightOption { get; set; }
  }
  
  public class FlightOption
  {
      public string LegRef { get; set; }
      public string Destination { get; set; }
      public string Origin { get; set; }
      public Option Option { get; set; }
  }
  
  public class Option
  {
      public string Key { get; set; }
      public string TravelTime { get; set; }
      public List&lt;BookingInfo&gt; BookingInfo { get; set; }
      public Connection Connection { get; set; }
  }
  
  public class BookingInfo
  {
      public string BookingCode { get; set; }
      public string BookingCount { get; set; }
      public string CabinClass { get; set; }
      public string FareInfoRef { get; set; }
      public string SegmentRef { get; set; }
  }
  </code></pre>
  
  <p>I want to deserialize it, but its giving me an error as following:</p>
  
  <p><strong>Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[ParseSoapEnveloperReqRes.BookingInfo]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
  To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
  Path 'FlightOptionsList.FlightOption[0].Option.BookingInfo.BookingCode', line 394, position 59.</strong></p>
  
  <p>this is because, as if you see the json string, FlightOptionsList.FlightOption[0].Option.<strong>BookingInfo</strong> is an <em>object</em> but in FlightOptionsList.FlightOption[1].Option.<strong>BookingInfo</strong> is an <em>array</em> as you can see. </p>
  
  <p>how can I set this problem... I am using the following code to deserialize the json string to class object</p>
  
  <pre><code> var AirTravelResultModel = JsonConvert.DeserializeObject&lt;AirTravelResultModel&gt;(xmlInputData);
  </code></pre>