title: Decode an optional Dictionary without actual mapping in Swift 4
body: <p>I have a struct which contains an optional metaData field of type <code>[String: Any]?</code>. I'd like to parse a JSON to that struct and explicitly not map the dictionary but keep it as is.</p>
  
  <pre><code>struct MyObject: Decodable {
      let id: String
      let whatever: String
      let metaData: [String: Any]?
  
      enum CardKeys: String, CodingKey {
          case id
          case whatever
          case metaData
      }
  
      init(from decoder: Decoder) throws {
          let container = try decoder.container(keyedBy: CardKeys.self)
          id = try container.decode(String.self, forKey: .id)
          whatever = try container.decode(String.self, forKey: .whatever)
          metaData = try container.decodeIfPresent([String: Any].self, forKey: .metaData)
      }
  }
  </code></pre>
  
  <p>That code compiles and starts but fails at runtime. I guess that <code>[String: Any]</code> just is not an valid type I can use here. But how would I do it then?</p>