title: Decoding JSON array of different types in Swift
body: <p>I'm trying to decode the following JSON Object</p>
  
  <pre><code>{
      "result":[
               {
               "rank":12,
               "user":{ 
                       "name":"bob","age":12 
                      } 
               }, 
               {
               "1":[ 
                    {
                      "name":"bob","age":12
                    },
                    {
                     "name":"tim","age":13
                    }, 
                    {
                     "name":"tony","age":12
                    }, 
                    {
                     "name":"greg","age":13
                    } 
                   ] 
              } 
             ] 
  }
  </code></pre>
  
  <p>struct userObject {
     var name: String
     var age:  Int
  }</p>
  
  <p>Basically a JSON Array with two different object types</p>
  
  <pre><code>{ "rank":12, "user": {userObject} }
  </code></pre>
  
  <p>and a
  "1" :  array of <code>[userObjects]</code></p>
  
  <pre><code>struct data: Decodable {
     rank: Int
     user: user
     1:    [user]  &lt;-- this is one area Im stuck
  }
  </code></pre>
  
  <p>Thanks in advance</p>