Top "Decodable" questions

Use this tag only for questions directly pertaining to the Swift Decodable protocol introduced in Swift 4.

debugDescription: "Expected to decode Array<Any> but found a dictionary instead.", underlyingError: nil)

I want to load an online json file into my application, but I am running into this error: typeMismatch(Swift.…

json swift struct decodable
What is difference between optional and decodeIfPresent when using Decodable for JSON Parsing?

I am using Codable protocol from Swift 4 first time, I am not able to understand use of decodeIfPresent from Decodable. /// …

swift swift4 codable decodable
Expected to decode Int but found a number instead

I had issue with JSON parsing in Swift 4.2. Here is the following code which shown runtime error. My Json data …

ios json codable decodable swift4.2
Swift 4 + Alamofire Decodable Json URL format

I have a JSON format which I do not decodable with Alamofire. Here is my json: "data":[ { "id":37, "status":"A\…

swift alamofire swift4 decodable
Ignore non-Codable optional properties in Codable object

When conforming to Codable protocol, I cannot easily skip optional property of non-Codable class In Ride struct we want to …

json swift swift4 codable decodable