Add assertions to prevent attempts to create request descriptor objects with inappropriate mappings. fixes #976

This commit is contained in:
Blake Watters
2012-10-14 14:57:02 -04:00
parent 1beb11ac1b
commit d823217993
7 changed files with 122 additions and 14 deletions

View File

@@ -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"]];