title: AlamofireObjectMapper Generic parameter 'T' could not be inferred
body: <p>i'm trying to have a system where all my api requests path through one function and map them to the corresponding object</p>
  
  <pre><code>func sendApi&lt;T&gt;(url : String , httpMethod : HTTPMethod = .get,
                   parameters: Parameters? = nil,
                   encoding: ParameterEncoding = URLEncoding.default,
                   headers: HTTPHeaders? = nil , callbackSuccess : @escaping (T) -&gt; () , callbackFailure : @escaping (T) -&gt; ()) where T : Mappable {
  
      Alamofire.request(url, method: httpMethod, parameters: parameters , encoding: encoding, headers: headers).responseObject{(response: (DataResponse&lt;T&gt;))in
  
              switch response.result {
  
              case .success :
                  let result  = Mapper&lt;T&gt;().map(JSONObject: response.value)!
                  callbackSuccess(result)
                  break;
              case .failure(let error):
                  if((error as NSError).code == ErrorResponse.noInternetConnection){
                      //  errorCallBack(ErrorResponse.noInternetConnectionString)
                  }
                  // errorCallBack(error.localizedDescription)
                  print(error.localizedDescription)
                  break;
              }
      }
  }
  </code></pre>
  
  <p>but when i try to call the function inside a get method for example </p>
  
  <pre><code> func testApiGet(url: String , packageId : Int ,callback :@escaping (myObject) -&gt; Void , errorCallBack : @escaping (String) -&gt; Void ){
  
          let token = spm.getUserToken()
          let headers = ["X-Auth-Token" : token]
          let newUrl = url + "?packageId=" + String(packageId)
  
          sendApi(url: url, httpMethod: HTTPMethod.get , parameters: nil, encoding: JSONEncoding.default, headers: headers, callbackSuccess: {(jsonObject) in
  
          } , callbackFailure:{ (jsonObject)in
  
          })        
      }
  </code></pre>
  
  <p>i get the error "Generic parameter 'T' could not be inferred"</p>
  
  <p>of course i can set the type of the object </p>
  
  <pre><code>(response: (DataResponse&lt;myObject&gt;)
  </code></pre>
  
  <p>and the error will go.</p>
  
  <p>my question is how solve this error to make it fully generic</p>