     }
   }
   
-  private func mapSubObject(key: String, jsonKey: String, inout value: AnyObject) {
-    let mappingObjectClass = self.getMappingObjectClass()
-    guard mappingObjectClass.keys.contains(jsonKey) else {return}
+  private func mapSubObject(key: String, jsonKey: String, mappingObjectClass: [String: AnyClass], inout value: AnyObject) {
     guard let objClass = mappingObjectClass[jsonKey] as? NSObject.Type else {
+      fatalError("Reflect error: Sub-model is not a subclass of NSObject")
+    }
+    let model = objClass.init()
+    guard value is NSDictionary || value is [String: AnyObject] else {
+      debugPrint("Reflect error: Error key: \(key) -- mapping sub-model without a dictionary json")
+      return
+    }
+    model.mapProperty(value)
+    value = model
+  }
+  
+  private func mapSubObjectArray(key: String, jsonKey: String, inout value: AnyObject) {
+    let mappingElementClass = self.getMappingElementClass()
+    guard mappingElementClass.keys.contains(jsonKey) else {return}
+    guard let objClass = mappingElementClass[jsonKey] as? NSObject.Type else {
       fatalError("Reflect error: Sub-model is not a subclass of NSObject")
     }
     let model = objClass.init()

    mappingObjectClass = res.takeUnretainedValue() as! [String: AnyClass]
    return mappingObjectClass
  }
}

      }
      
      // map sub object
      if mappingObjectClass.keys.contains(jsonKey) {
        mapSubObject(key, jsonKey: jsonKey, mappingObjectClass: mappingObjectClass, value: &value!)
      }
      
      // map sub array
      setPropertyValue(value, forKey: key)
