title: Swift Codable with Different Array Types
body: <p>I'm writing a program where I'm parsing <code>JSON</code> data that includes array of arrays, where the nested arrays have different object types (specifically, [[String, String, Int]]). For example, </p>
  
  <pre><code>{
  "number": 5295,
  "bets": [
      [
          "16",
          "83",
          9
      ],
      [
          "75",
          "99",
          4
      ],
      [
          "46",
          "27",
          5
      ]
  ]
  }
  </code></pre>
  
  <p>I'm trying to use codable to help me parse the data, but when I try something like</p>
  
  <pre><code>struct OrderBook: Codable {
      let number: Int
      let bets: [Bet]
  }
  
  struct Bet: Codable {
      let price: String
      let sale: String
      let quantity: Int
  }
  </code></pre>
  
  <p>it gives me errors saying that </p>
  
  <blockquote>
    <p>Expected to decode Dictionary<code>&lt;String, Any&gt;</code> but found an array instead</p>
  </blockquote>
  
  <p>How do I get around this? I can't declare an array of empty type. </p>