Swift Codable null handling
I have a struct that parse JSON using Codable . struct Student: Codable { let name: String? let amount: Double? let adress: String? } Now if the amount value is coming as null the JSON parsing is failing. So should I manually handle the null cases for all the Int and Double that are present in the Student struct? The String values coming as null is automatically handled. Let me do this Playground for you since an example shows you more than a hundred words: import Cocoa struct Student: Codable { let name: String? let amount: Double? let adress: String? } let okData = """ { "name": "here",