Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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
30,501 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.