title: How to deserialise a JSON multidimensional array with dimensions encoded in the keys
body: <p>I'm working with a JSON API (no I can't change it!) that encodes a calendar schedule in the following format.</p>
  
  <pre><code>{  
      "values":
      {  
          "schedule[monday][0][time]":"06:30",  
          "schedule[monday][0][active]":false,  
          "schedule[monday][1][time]":"09:00",  
          "schedule[monday][1][active]":true,  
          "schedule[monday][2][time]":"16:30",  
          "schedule[monday][2][active]":true,  
          "schedule[tuesday][0][time]":"06:30",  
          "schedule[tuesday][0][active]":false,  
          "schedule[tuesday][1][time]":"09:00",  
          "schedule[tuesday][1][active]":true
      }
  }
  </code></pre>
  
  <p>You can see they have essentially encoded the dimensions of the array (consisting of Day of Week, index of schedule and information about that index) into the <em>key</em> instead of nesting. I've been trying to deserialise into a typed collection such as (attributes removed for brevity):</p>
  
  <pre><code>    public class Foo
      {
          public Dictionary&lt;DayOfWeek, List&lt;Active&gt;&gt; Schedule{ get; set; }
      }
  
      public class Active
      {
          public DateTime Time { get; set; };
          public bool IsActive { get; set; };
      }
  </code></pre>
  
  <p>But for the purposes of getting it working I'd happily take either something simpler like <code>Dictionary&lt;DayOfWeek, List&lt;Tuple&lt;DateTime,Bool&gt;&gt;&gt;</code> or even an untyped multidimensional <code>object[]</code> where I can convert it into something more sensible but I do need to be able to serialise it back.</p>
  
  <p>I've been trying to use Json.Net's JsonCreationConverter but it really doesn't seem geared to do this kind of conversion. Is there a better Json.Net (or other) API to use or some trick I've missed?</p>