mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-05-09 03:48:07 +08:00
Add assertions to prevent attempts to create request descriptor objects with inappropriate mappings. fixes #976
This commit is contained in:
@@ -92,7 +92,7 @@
|
||||
[RKResponseDescriptor responseDescriptorWithMapping:humanMapping pathPattern:nil keyPath:@"humans" statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)]
|
||||
]];
|
||||
|
||||
RKObjectMapping *humanSerialization = [RKObjectMapping mappingForClass:[NSDictionary class]];
|
||||
RKObjectMapping *humanSerialization = [RKObjectMapping requestMapping];
|
||||
[humanSerialization addPropertyMapping:[RKAttributeMapping attributeMappingFromKeyPath:@"name" toKeyPath:@"name"]];
|
||||
[self.objectManager addRequestDescriptor:[RKRequestDescriptor requestDescriptorWithMapping:humanSerialization objectClass:[RKHuman class] rootKeyPath:@"human"]];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user