I have a JSON document which contains objects with known schema in an object with unknown keys and I\'ll like to map that with RestKit. Let me explain this:
Maybe check out JSONKit https://github.com/johnezang/JSONKit to create a NSDictionary from your JSON document.
You could do something like this:
RKObjectMapping* mapping = [RKDynamicObjectMapping dynamicMapping];
mapping.objectMappingForDataBlock = ^(id data) {
NSDictionary* object = [data objectForKey: @"object"];
NSArray* keys = [object allKeys];
RKObjectMapping* dataMapping = [RKObjectMapping objectMapping];
//Use the keys to define mapping
return dataMapping;
};