title: Codable, Decodable only a value out of Dictionary
body: <p>I have a json response of an API. This returns a also value, which is a Dictionary. How to can I achieve to store / map only the value of this Dictionary. Here is an example which can be simply put into a playground:</p>
  
  <pre><code>id = ["$oid": "591ae6cb9d1fa2b6e47edc33"]
  </code></pre>
  
  <p>should only be </p>
  
  <pre><code>id = "591ae6cb9d1fa2b6e47edc33"
  </code></pre>
  
  <p>Here is an example which can be simply put into a playground:</p>
  
  <pre class="lang-swift prettyprint-override"><code>import Foundation
  
  struct Location : Decodable {
      enum CodingKeys : String, CodingKey {
          case id = "_id"
      }
      var id : [String:String]? // this should be only a string with the value of "$oid"
  }
  
  extension Location {
      public init(from decoder: Decoder) throws {
          let values = try decoder.container(keyedBy: CodingKeys.self)
          id = try values.decode([String:String]?.self, forKey: .id)
      }
  }
  
  
  var json = """
  [
      {
          "_id": {
              "$oid": "591ae6cb9d1fa2b6e47edc33"
          }
      },
      {
          "_id": {
              "$oid": "591ae6cd9d1fa2b6e47edc34"
          }
      }
  ]
  
  """.replacingOccurrences(of: "}\n{", with: "}\\n{").data(using: .utf8)!
  
  let decoder = JSONDecoder()
  
  do {
      let locations = try decoder.decode([Location].self, from: json)
      locations.forEach { print($0) }
  } catch {
      print(error.localizedDescription )
  }
  </code></pre>