title: Json.NET: deserialize json arrays
body: <p>I'm trying to process a JSON structure with Json.NET and encountered some issues:</p>
  
  <p>My classes don't work when a JSON contains an unnamed array.</p>
  
  <p><strong>Json Example:</strong></p>
  
  <pre><code>{
      "graph_property" : [{
              "name" : "calculation_method",
              "value" : "Arithmetic"
          }, {
              "name" : "graph_type",
              "value" : "TIME"
          }
      ],
      "measurement" : [{
              "id" : "9997666",
              "alias" : "Measurement (TxP)[IE]-Home Page - Total Time (seconds)",
              "bucket_data" : [{
                      "name" : "2013-MAR-18 12:00 AM",
                      "id" : 1,
                      "perf_data" : {
                          "value" : "2.244",
                          "unit" : "seconds"
                      },
                      "avail_data" : {
                          "value" : "99.67",
                          "unit" : "percent"
                      },
                      "data_count" : {
                          "value" : "299",
                          "unit" : "#"
                      }
                  }
              ],
              "graph_option" : [{
                      "name" : "perfwarning",
                      "value" : "-",
                      "unit" : "seconds"
                  }, {
                      "name" : "perfcritical",
                      "value" : "-",
                      "unit" : "seconds"
                  }, {
                      "name" : "availwarning",
                      "value" : "-",
                      "unit" : "percent"
                  }, {
                      "name" : "availcritical",
                      "value" : "-",
                      "unit" : "percent"
                  }, {
                      "name" : "bucketsize",
                      "value" : "86400",
                      "unit" : "seconds"
                  }, {
                      "name" : "rows",
                      "value" : "1",
                      "unit" : "#"
                  }, {
                      "name" : "pagecomponent",
                      "value" : "Total Time",
                      "unit" : "seconds"
                  }, {
                      "name" : "avg_perf",
                      "value" : "2.244",
                      "unit" : "seconds"
                  }, {
                      "name" : "avg_avail",
                      "value" : "99.67",
                      "unit" : "percent"
                  }, {
                      "name" : "total_datapoint_count",
                      "value" : "300",
                      "unit" : "#"
                  }, {}
  
              ]
          }, {
              "id" : "9997666",
              "alias" : "Measurement (TxP)[IE]-Women - Total Time (seconds)",
              "bucket_data" : [{
                      "name" : "2013-MAR-18 12:00 AM",
                      "id" : 1,
                      "perf_data" : {
                          "value" : "0.979",
                          "unit" : "seconds"
                      },
                      "avail_data" : {
                          "value" : "100.00",
                          "unit" : "percent"
                      },
                      "data_count" : {
                          "value" : "299",
                          "unit" : "#"
                      }
                  }
              ],
              "graph_option" : [{
                      "name" : "perfwarning",
                      "value" : "-",
                      "unit" : "seconds"
                  }, {
                      "name" : "perfcritical",
                      "value" : "-",
                      "unit" : "seconds"
                  }, {
                      "name" : "availwarning",
                      "value" : "-",
                      "unit" : "percent"
                  }, {
                      "name" : "availcritical",
                      "value" : "-",
                      "unit" : "percent"
                  }, {
                      "name" : "bucketsize",
                      "value" : "86400",
                      "unit" : "seconds"
                  }, {
                      "name" : "rows",
                      "value" : "1",
                      "unit" : "#"
                  }, {
                      "name" : "pagecomponent",
                      "value" : "Total Time",
                      "unit" : "seconds"
                  }, {
                      "name" : "avg_perf",
                      "value" : "0.979",
                      "unit" : "seconds"
                  }, {
                      "name" : "avg_avail",
                      "value" : "100.00",
                      "unit" : "percent"
                  }, {
                      "name" : "total_datapoint_count",
                      "value" : "299",
                      "unit" : "#"
                  }, {}
  
              ]
          }
      ],
      "link" : {
          "type" : "application/json",
          "href" : "http://api.website.tld?format=json",
          "rel" : "slotmetadata"
      }
  }
  </code></pre>
  
  <p><strong>Class for Json.NET:</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  
  namespace CAKR.Graph
  {
      /// &lt;summary&gt;
      /// Description of KN_Graph.
      /// &lt;/summary&gt;
      public class GraphProperty
      {
          public string name { get; set; }
          public string value { get; set; }
      }
  
      public class PerfData
      {
          public string value { get; set; }
          public string unit { get; set; }
      }
  
      public class AvailData
      {
          public string value { get; set; }
          public string unit { get; set; }
      }
  
      public class DataCount
      {
          public string value { get; set; }
          public string unit { get; set; }
      }
  
      public class BucketData
      {
          public string name { get; set; }
          public int id { get; set; }
          public PerfData perf_data { get; set; }
          public AvailData avail_data { get; set; }
          public DataCount data_count { get; set; }
      }
  
      public class GraphOption
      {
          public string name { get; set; }
          public string value { get; set; }
          public string unit { get; set; }
      }
  
      public class Measurement
      {
          public string id { get; set; }
          public string alias { get; set; }
          public List&lt;BucketData&gt; bucket_data { get; set; }
          public List&lt;GraphOption&gt; graph_option { get; set; }
      }
  
      public class Link
      {
          public string type { get; set; }
          public string href { get; set; }
          public string rel { get; set; }
      }
  
      public class RootObject
      {
          public List&lt;GraphProperty&gt; graph_property { get; set; }
          public List&lt;Measurement&gt; measurement { get; set; }
          public Link link { get; set; }
      }
  }
  </code></pre>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>var myObject = JsonConvert.DeserializeObject&lt;CAKR.Graph.Measurement&gt;(MyJsonString);
  </code></pre>
  
  <p>I'm not sure why I don't get an object containing the data of the "Measurment" child-array.
  If I insert named values, it works...</p>