Bug in the starter code of Chapter 10

In this chapter, we parse open and closed events from EONET API. However, even though EOEvent.closeDate is an optional in the API response, it is being forced in the EOEvent.init method. Thus, open events never get parsed. To fix this, please change try in closeDate = try? container.decode(Date.self, forKey: .closeDate) to try?.

Hope this helps future learners.

This topic was automatically closed after 166 days. New replies are no longer allowed.