Yalantis / FastEasyMapping

A tool for fast serializing & deserializing of JSON
https://yalantis.com/
Other
550 stars 78 forks source link

[feature] Mapping dictionary keys to entity properties #27

Open dodikk opened 9 years ago

dodikk commented 9 years ago

Having a server response (chunk)

"thumbnails":
{
     "120x79” : ”<url>”, 
    “800x600” : "<another URL>" 
}

I'd like to get two entities of "thumbnail" type having both dictionary key and its value stored in its properties.

@interface Thumbnail : NSManagedObject

@property (nonatomic, retain) NSString * imageDimensions; //  @"120x79”
@property (nonatomic, retain) NSString * url; // "<url>”

@end
dodikk commented 9 years ago

The home repo (EasyMapping/EasyMapping) seems to have the API to solve this problem. https://github.com/EasyMapping/EasyMapping/blob/master/EasyMapping/EKObjectMapping.h#L167

Please merge it to your fork.

dimazen commented 9 years ago

@dodikk I'll take a look on this weekends, thanks!