iOS Build a Weather App Refactoring Using Codable Recap: Refactoring Using Codable

Dominic Bryan
Dominic Bryan
14,452 Points

Recap: Refactoring Using Codable

import Foundation

struct Vehicle: Codable { let model: String

enum CodingKeys: String, CodingKey {
    case model = "model"
}

}

I dont see what is wrong with this answer

I agree it should work but they want you to omit the = "model" since infers string as a raw value

Christian A. Castro
Christian A. Castro
18,830 Points

Dominic Bryan same issue!! Did you solved out? Any recommendations.. please!!

Dominic Bryan
Dominic Bryan
14,452 Points

Christian A. Castro Yes, I followed Jordan Leahy's advice and omitted the = "model" from each case. All videos leading up to this practise example explicitly evaluated all enum cases to a String, but you do not have to, bit misleading from the lessons on this one.