Closed mayixingkong closed 5 years ago
json1 { "name1": "ObjectMapper", "url1": "https://github.com/Hearst-DD/ObjectMapper" }
json2 { "name2": "ObjectMapper", "url2": "https://github.com/Hearst-DD/ObjectMapper" }
struct Repo: Mappable { var name: String! var url: URL! init(_ map: Map) { name <- map["name"] url <- map["url"] } }
I faced a problem somewhat like this some time ago, what I did was converted the models to dict and then merge then created model from the merged dict
Your JSON dictionary:
json1 { "name1": "ObjectMapper", "url1": "https://github.com/Hearst-DD/ObjectMapper" }
json2 { "name2": "ObjectMapper", "url2": "https://github.com/Hearst-DD/ObjectMapper" }
Your model: