Скорее всего, вы используете неправильную структуру для декодирования json. Вот что вам нужно.
struct Response: Codable {
let status: String
let totalResults: Int
let articles: [Article]
}
struct Article: Codable {
let source: Source
let author: String?
let title, description, url, urlToImage: String
let publishedAt: String
let content: String?
}
struct Source: Codable {
let id: String?
let name: String
}