title: Swift 4 json decoder error flickr
body: <p>I am trying out the new JSONDecoder() in swift 4 and am trying to parse the following flickr API response : (<a href="https://api.flickr.com/services/rest/?api_key=api_key&amp;method=flickr.photos.search&amp;format=json&amp;per_page=25&amp;text=hello&amp;nojsoncallback=1" rel="noreferrer">https://api.flickr.com/services/rest/?api_key=api_key&amp;method=flickr.photos.search&amp;format=json&amp;per_page=25&amp;text=hello&amp;nojsoncallback=1</a>).  However I get an error saying that "error processing json data: The data couldn’t be read because it isn’t in the correct format."  However the data seems to be in the correct format to me.  Am I doing anything wrong?</p>
  
  <pre><code>            let dataTask = session.dataTask(with: urlRequest) { (data, response, error) in
                  if let error = error {
                      print("json error: \(error.localizedDescription)")
                      return
                  } else if let data = data {
                      print(response)
                      do {
                          let decoder = JSONDecoder()
                          print(data)
                          let flickrPhotos = try decoder.decode(FlickrImageResult.self, from: data)
                      } catch {
                          dump(data)
                          print("json error: \(error.localizedDescription)")
                      }
                  }
              }
              dataTask.resume()
  </code></pre>
  
  <p>My data models are </p>
  
  <pre><code>struct FlickrImageResult : Codable {
       var photos : FlickrPhoto? = nil
  
  }
  
  struct FlickrPhoto : Codable {
      var photo : [FlickrURLs]? = nil
   }
  
  struct FlickrURLs: Codable {
      var id : String? = nil
      var owner: String? = nil
      var secret: String? = nil
      var server: String? = nil
      var farm: String? = nil
  }
  </code></pre>
  
  <p>I changed the number of images requested to 2 and Printing out the data returns 
          Optional({"photos":{"page":1,"pages":120197,"perpage":2,"total":"240393","photo":[{"id":"36729752762","owner":"152440263@N02","secret":"e62ba3e18b","server":"4432","farm":5,"title":"Hello there","ispublic":1,"isfriend":0,"isfamily":0},{"id":"36729384952","owner":"141041947@N06","secret":"bc0e5af630","server":"4380","farm":5,"title":"POST\ud83d\udd25 #891 | Hello Tuesday | Krescendo","ispublic":1,"isfriend":0,"isfamily":0}]},"stat":"ok"})</p>