Open JARNBOY opened 4 years ago
{ "name": "ObjectMapper", "url": "https://github.com/Hearst-DD/ObjectMapper" }
struct Repo: Mappable { var name: String! var url: URL! init(_ map: Map) { name <- map["name"] url <- map["url"] } }
let repo = Mapper<Repo>().map(myJSONDictionary)
I exepected something like:
Repo(name: "ObjectMapper", url: "https://github.com/Hearst-DD/ObjectMapper")
Repo(name: "ObjectMapper", url: nil) // expected the url is mapped correctly
Your JSON dictionary:
Your model:
What you did:
What you expected:
I exepected something like:
What you got: