I have realized something in Objective Support regarding the
deserialization of "null", at least JSON deserialization.
This test case {"test_class":{"created_at":null,"name":null}} results
in
> I have realized something in Objective Support regarding the
> deserialization of "null", at least JSON deserialization.
> This test case {"test_class":{"created_at":null,"name":null}} results
> in
> I found the problem is in NSString+Deserialize.m:
> + (NSString *) deserialize:(id)value {
> return [NSString stringWithFormat:@"%@",value];
> }
> If value is [NSNull null], we deserialize as (surprise!) "<null>". Is
> this the expected behavior?
> Rodrigo
> On Sep 4, 9:43 am, iPhoneCode <rodrigo.mazzi...@gmail.com> wrote:
>> Hi folks,
>> I have realized something in Objective Support regarding the
>> deserialization of "null", at least JSON deserialization.
>> This test case {"test_class":{"created_at":null,"name":null}} results
>> in
This approach doesn't work, as in NSObject+JSONSerializableSupport,
method deserializeJSON, we use the Class definition of the receiver,
i.e.
the objective_support class would need to have a NSNull * attribute,
which is obviously wrong.
The solution is very similar to the one we did in NSDate+Serialize.h.
I will fix it and push on my repository... details later.
Rodrigo
On Sep 4, 9:59 am, Josh Vickery <vicke...@gmail.com> wrote:
> > I found the problem is in NSString+Deserialize.m:
> > + (NSString *) deserialize:(id)value {
> > return [NSString stringWithFormat:@"%@",value];
> > }
> > If value is [NSNull null], we deserialize as (surprise!) "<null>". Is
> > this the expected behavior?
> > Rodrigo
> > On Sep 4, 9:43 am, iPhoneCode <rodrigo.mazzi...@gmail.com> wrote:
> >> Hi folks,
> >> I have realized something in Objective Support regarding the
> >> deserialization of "null", at least JSON deserialization.
> >> This test case {"test_class":{"created_at":null,"name":null}} results
> >> in
> This approach doesn't work, as in NSObject+JSONSerializableSupport,
> method deserializeJSON, we use the Class definition of the receiver,
> i.e.
> the objective_support class would need to have a NSNull * attribute,
> which is obviously wrong.
> The solution is very similar to the one we did in NSDate+Serialize.h.
> I will fix it and push on my repository... details later.
> Rodrigo
> On Sep 4, 9:59 am, Josh Vickery <vicke...@gmail.com> wrote:
> > Nice catch. If that's the problem, I think we could fix that with a
> > category on NSNull, NSNull+Deserialize that would have:
> > > I found the problem is in NSString+Deserialize.m:
> > > + (NSString *) deserialize:(id)value {
> > > return [NSString stringWithFormat:@"%@",value];
> > > }
> > > If value is [NSNull null], we deserialize as (surprise!) "<null>". Is
> > > this the expected behavior?
> > > Rodrigo
> > > On Sep 4, 9:43 am, iPhoneCode <rodrigo.mazzi...@gmail.com> wrote:
> > >> Hi folks,
> > >> I have realized something in Objective Support regarding the
> > >> deserialization of "null", at least JSON deserialization.
> > >> This test case {"test_class":{"created_at":null,"name":null}} results
> > >> in