title: Swift: Decodable
body: <p>Lets say i have this json from an API request:</p>
  
  <pre><code>friends: {  
     "john":31,
     "mark":27,
     "lisa":17,
     "tom":41
  }
  </code></pre>
  
  <p>I usually expect it in an array format:</p>
  
  <pre><code>friends: [  
     { "john":31 },
     { "mark":27 },
     { "lisa":17 },
     { "tom":41 }
  ]
  </code></pre>
  
  <p>But the API doesn't provide me this way the results. So i want finally to map it to an array of [Friend], where Friend is:</p>
  
  <pre><code>class Friend: Decodable {
    let name: String
    let age: Int
  }
  </code></pre>
  
  <p>How should i serialize this json to get [Friend] ?</p>