Hi,
Not sure about the explanation on property mapping. While doing debug step
by step because i didn't have anymore my json mapped to object i reach the
case where server response have a field in JSON "bar", which i didn't use
in my Model on my app, and the debug goes to line 150.

And about the error, let read the block 150 - 159
If no error present, we do nothing except returning 'nil', so the actual
error is not described and is silent.

Thx




On Tue, May 13, 2014 at 5:05 PM, Robert Böhnke <notifications@github.com>wrote:

> In Mantle/MTLJSONAdapter.m:
>
> > @@ -102,7 +103,24 @@ - (id)initWithJSONDictionary:(NSDictionary *)JSONDictionary modelClass:(Class)mo
> >
> >  	NSMutableDictionary *dictionaryValue = [[NSMutableDictionary alloc] initWithCapacity:JSONDictionary.count];
> >
> > -	for (NSString *propertyKey in [self.modelClass propertyKeys]) {
> > +	NSSet *propertyKeys = [self.modelClass propertyKeys];
> > +
> > +	for (NSString *JSONKeyPath in self.JSONKeyPathsByPropertyKey) {
> > +		if ([propertyKeys containsObject:JSONKeyPath]) continue;
> > +
> > +		if (error != NULL) {
>
> This only affects the property mapping in your model, so if you say map
> the property foo to the JSON key bar, this will only make sure that your
> class actually has a property foo. If your server's response actually
> contains bar or a different set of keys entirely is a different matter.
>
> The if (error != NULL) is needed to make sure that we're not
> dereferencing a NULL pointer when assigning the NSError later.
>
> Also check out #325 <https://github.com/Mantle/Mantle/pull/325> where
> we're changing this to an exception.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Mantle/Mantle/pull/294/files#r12588116>
> .
>