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
Decode PropertyList using Swift 4 Codable PropertyListDecoder()

Im trying to decode a plist using PropertyListDecoder() but when I get to the trying to access the keys, I …

swift swift4 property-list codable decodable
Swift: Codable - extract a single coding key

I have the following code to extract a JSON contained within a coding key: let value = try! decoder.decode([String:…

ios json swift codable decodable