Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Jordan Leahy
Jordan Leahy
25,054 Points

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
23,601 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.