Open wing328 opened 8 years ago
Would be awesome! Note there is AlamofireObjectMapper as well, which makes using ObjectMapper in combination with Alamofire even easier.
For those who are interested in adding the mapping for ObjectMapper, e.g.
// Mappable
func mapping(map: Map) {
username <- map["username"]
age <- map["age"]
weight <- map["weight"]
array <- map["arr"]
dictionary <- map["dict"]
bestFriend <- map["best_friend"]
friends <- map["friends"]
birthday <- (map["birthday"], DateTransform())
}
Here is the logic you can borrow from PHP model template (which needs something very similar for mapping attribute names):
static $attributeMap = array(
{{#vars}}'{{name}}' => '{{baseName}}'{{#hasMore}},
{{/hasMore}}{{/vars}}
);
Would be great to move to this model instead of current one.
@romk1n may I know if you would be interested in making the contribution?
@wing328 unfortunately don't have time to get it done, sorry :(
👍
We want to leverage ObjectMapper for easier conversion between models and JSON.
If anyone from the community wants to work on this task, please reply to let us know.