title: debugDescription: "Expected to decode Array<Any> but found a dictionary instead.", underlyingError: nil)
body: <p>I want to load an online json file into my application, but I am running into this error:</p>
  <blockquote>
  <p>typeMismatch(Swift.Array,
  Swift.DecodingError.Context(codingPath: [], debugDescription:
  &quot;Expected to decode Array but found a dictionary instead.&quot;,
  underlyingError: nil))</p>
  </blockquote>
  <p>I have looked on stackoverflow but other sollutions didn't help to solve mine.</p>
  <p>My JSON:</p>
  <pre><code>{
    &quot;copyright&quot; : &quot;NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2022. All Rights Reserved.&quot;,
    &quot;totalItems&quot; : 0,
    &quot;totalEvents&quot; : 0,
    &quot;totalGames&quot; : 0,
    &quot;totalMatches&quot; : 0,
    &quot;metaData&quot; : {
      &quot;timeStamp&quot; : &quot;20220813_172145&quot;
    },
    &quot;wait&quot; : 10,
    &quot;dates&quot; : [ ]
  }
  </code></pre>
  <p>My datamodel:</p>
  <pre><code>import Foundation
  
  struct Initial: Codable {
      let copyright: String
      let totalItems: Int
      let totalEvents: Int
      let totalGames: Int
      let totalMatches: Int
      let wait: Int
      let dates: [Dates]
  }
  
  struct Dates: Codable {
      let date: String
      let totalItems: Int
      let totalEvents: Int
      let totalGames: Int
      let totalMatches: Int
      let games: [Game]
  }
  
  struct Game: Codable {
      let gamePk: Int
      let link: String
      let gameType: String
      let season: String
      let gameDate: String
      let status: Status
      let teams: Team
      let venue: Venue
      let content: Content
  }
  
  struct Status: Codable {
      let abstractGameState: String
      let codedGameState: Int
      let detailedState: String
      let statusCode: Int
      let startTimeTBD: Bool
  }
  
  struct Team: Codable {
      let away: Away
      let home: Home
  }
  
  struct Away: Codable {
      let leagueRecord: LeagueRecord
      let score: Int
      let team: TeamInfo
  }
  
  struct Home: Codable {
      let leagueRecord: LeagueRecord
      let score: Int
      let team: TeamInfo
  }
  
  struct LeagueRecord: Codable {
      let wins: Int
      let losses: Int
      let type: String
  }
  
  struct TeamInfo: Codable {
      let id: Int
      let name: String
      let link: String
  }
  
  struct Venue: Codable {
      let name: String
      let link: String
  }
  
  struct Content: Codable {
      let link: String
  }
  </code></pre>
  <p>and here is my viewcontroller</p>
  <pre><code>import UIKit
  
  class TodaysGamesTableViewController: UITableViewController {
      var todaysGamesURL: URL = URL(string: &quot;https://statsapi.web.nhl.com/api/v1/schedule&quot;)!
      
      var gameData: [Dates] = []
      let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
  
      override func viewDidLoad() {
          super.viewDidLoad()
          loadTodaysGames()
      }
  
      func loadTodaysGames(){
          print(&quot;load Games&quot;)
          
          view.addSubview(activityIndicator)
          activityIndicator.frame = view.bounds
          activityIndicator.startAnimating()
          
          let todaysGamesDatatask = URLSession.shared.dataTask(with: todaysGamesURL, completionHandler: dataLoaded)
          
          todaysGamesDatatask.resume()
      }
      
      func dataLoaded(data:Data?,response:URLResponse?,error:Error?){
          if let detailData = data{
              print(&quot;detaildata&quot;, detailData)
              let decoder = JSONDecoder()
              do {
                  let jsondata = try decoder.decode([Dates].self, from: detailData)
                  gameData = jsondata //Hier .instantie wil doen krijg ik ook een error
                 
                  DispatchQueue.main.async{
                      self.tableView.reloadData()
                  }
              }catch let error{
                  print(error)
              }
          }else{
              print(error!)
          }
      }
  </code></pre>