title: Codables error with Alamofire "Cannot convert value of type '[String : Any]' to expected argument type 'Data'"
body: <p>I got the response from API by using Alamofire, That response is in the form of [String:Any], i am trying to convert that response into codable format it showing error "Cannot convert value of type '[String : Any]' to expected argument type 'Data".</p>
  
  <p>PLease find my following code and help to me.</p>
  
  <pre><code>func apiHandling(){
          Alamofire.request(catrgeryurl, method: .get, parameters: nil, headers: nil).responseJSON { (response) in
              if response.result.value != nil{
                  if let data = response.result.value as? [String:Any]{
                      if let myStruct = try? JSONDecoder().decode(Mainsite.self, from: data) {
                          //do something with myStruct
                          print(myStruct)
                      } else {
                          //handle myStruct being nil
                      }
                  }
              }
          }
      }
  </code></pre>