tristanhimmelman/AlamofireObjectMapper

array response with key

Closed this issue · 3 comments

smoi commented

my server returns a response like this

{data:[array of devices]}

How can i get those kind of data? If I do responseArray i can't get it. If i do responseObject("data") I can't use an array. How should I do? Is this possible with object mapper?

You should be able to use this function:

public func responseArray<T: Mappable>(keyPath: String, completionHandler: Response<[T], NSError> -> Void) -> Self
smoi commented

Workend like a charm, thanks!

How would I do this in the current version? That function doesn't exist anymore, afaik.