title: Filter data From vapor client get
body: <p>i'm using vapor's client to fetch a get request.</p>
  
  <pre><code>func sendGetRequest(req: Request) throws -&gt; Future&lt;Response&gt; {
      let client = try req.make(FoundationClient.self)
      return client.get("http://example.vapor.codes/json", headers: ["Accept-Language" : "ar"])
          .map(to: Response.self, { clientResponse in
          let response = req.makeResponse()
          response.http.status = clientResponse.http.status
          response.http.body = clientResponse.http.body
          return response
      })
  }
  </code></pre>
  
  <p>this returns all the json data , i want to filter it to just return 2 attributes, for example in this case (dict,number)</p>
  
  <p>i've created a model for the data </p>
  
  <pre><code>struct ExampleData: Codable {
    //  var array : [Int]
      var dict : [String : String]
      var number : Int
   //   var string : String
  }
  </code></pre>
  
  <p>the function expects me to return a Future&lt; Response>, but if i change it to  Future&lt; ExampleData> and set the mapping to .map(to: ExampleData.self ..)</p>
  
  <p>i get </p>
  
  <blockquote>
    <p>Cannot convert return expression of type 'Response' to return type
    'TodoController.ExampleData'</p>
  </blockquote>