title: How to decode a property with type of JSON dictionary in Swift [45] decodable protocol
body: <p>Let's say I have <code>Customer</code> data type which contains a <code>metadata</code> property that can contains any JSON dictionary in the customer object</p>
  
  <pre><code>struct Customer {
    let id: String
    let email: String
    let metadata: [String: Any]
  }
  </code></pre>
  
  <hr>
  
  <pre><code>{  
    "object": "customer",
    "id": "4yq6txdpfadhbaqnwp3",
    "email": "john.doe@example.com",
    "metadata": {
      "link_id": "linked-id",
      "buy_count": 4
    }
  }
  </code></pre>
  
  <p><strong>The <code>metadata</code> property can be any arbitrary JSON map object.</strong></p>
  
  <p>Before I can cast the property from a deserialized JSON from <code>NSJSONDeserialization</code> but with the new Swift 4 <code>Decodable</code> protocol, I still can't think of a way to do that.</p>
  
  <p>Do anyone know how to achieve this in Swift 4 with Decodable protocol?</p>