title: Not able to convert repository object to AnyObject for import
body: <p>I need to bulk import a json data set of approximately 30,000 records into a Realm database.</p>
  
  <p>My decodable setup for the repository object:</p>
  
  <pre><code>struct Repository {
      let xxxx:Int
      let xxxx:String
      let xxxx:String
      let xxxx:Int
      let xxxx:String
      let xxxx:String
      let xxxx:String
  }
  
  extension Repository : Decodable {
      static func decode(json: AnyObject) throws -&gt; Repository {
          return try Repository(
              xxxx: json =&gt; "xxxx",
              xxxx: json =&gt; "xxxx",
              xxxx: json =&gt; "xxxx",
              xxxx: json =&gt; "xxxx",
              xxxx: json =&gt; "xxxx",
              xxxx: json =&gt; "xxxx",
              xxxx: json =&gt; "xxxx"
          )
      }
  }
  </code></pre>
  
  <p>For the realm import I have:</p>
  
  <pre><code>                    let config = Realm.Configuration(
                          path: utility.getDocumentsDirectory().stringByAppendingPathComponent("Meta.realm"),
                          readOnly: false)
  
                      let realm = try! Realm(configuration: config)
  
                      try! realm.write {
                          let json = try! NSJSONSerialization.JSONObjectWithData(jsonData, options: [])
                          let repo = try! [Repository].decode(json)
  
                          realm.create(Meta.self, value: repo, update: true)
                      }
  </code></pre>
  
  <p>The problem is the repo object is of a custom class/object type for Decodable, and is not convertable to AnyObject for the value label in the realm.create</p>