title: Why fail in request with Alamofire?
body: <p>I want to get data of github/users, then i try two methods:</p>
  
  <p>The first method is succesful:</p>
  
  <pre><code>AF.request("https://api.github.com/users").responseJSON { response in
      print("UOUOUOUOUOU", response.description)
  }
  </code></pre>
  
  <p>But with the second it fails, why?</p>
  
  <pre><code>Network.request(Request.users).responseDecodable { (response: AFDataResponse&lt;UserList&gt;) in
        switch response.result {
        case .success(let value):
          print("SUCCESS")
        case .failure(let error):
              print("FAIL")
        }
      }
  </code></pre>
  
  <p>I need to use the second method.</p>
  
  <p>This is my class Network</p>
  
  <pre><code>class Network {
    let session: Session
    let evaluators = ["api.github.com/users": PinnedCertificatesTrustEvaluator(certificates: [
          Certificates.github
          ])
    ]
  
    private init() {
      session = Session(serverTrustManager: ServerTrustManager(evaluators: evaluators)
      )
    }
  
    private static let shared = Network()
    static func request(_ convertible: URLRequestConvertible) -&gt; DataRequest {
      return shared.session.request(convertible)
    }
  }
  </code></pre>
  
  <p>i get this error:</p>
  
  <pre><code>FAIL serverTrustEvaluationFailed(reason: Alamofire.AFError.ServerTrustFailureReason.noRequiredEvaluator(host: "api.github.com"))
  2019-12-17 12:03:21.649222-0400 SSLOwner[5533:83111] Task &lt;57DC5433-F132-4453-BB68-CCF90B5F6058&gt;.&lt;1&gt; HTTP load failed, 0/0 bytes (error code: -999 [1:89])
  </code></pre>
  
  <p>edit 1: this is my Struct UserList and User</p>
  
  <pre><code>import Foundation
  struct UserList: Codable {
    let users: [User]
  
    enum CodingKeys: String, CodingKey {
      case users = "items"
    }
  }
  
  
  struct User: Codable {
    let displayName: String
  
  }
  </code></pre>
  
  <p>with </p>
  
  <pre><code>session = Session()
  </code></pre>
  
  <p>i get this error:</p>
  
  <blockquote>
    <p>responseSerializationFailed(reason:
    Alamofire.AFError.ResponseSerializationFailureReason.decodingFailed(error:
    Swift.DecodingError.typeMismatch(Swift.Dictionary,
    Swift.DecodingError.Context(codingPath: [], debugDescription:
    "Expected to decode Dictionary but found an array
    instead.", underlyingError: nil))))</p>
  </blockquote>