Skip to content

Commit 9976df2

Browse files
author
Josh Holtz
committed
Merge pull request #26 from christianklotz/master
Fix #22 and allow `null` values in JSON when interoperating with Swift
2 parents a1fac54 + 4a1835f commit 9976df2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Classes/JSONAPIErrorResource.h

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Copyright (c) 2015 Josh Holtz. All rights reserved.
77
//
88

9+
#import <Foundation/Foundation.h>
10+
911
/**
1012
* Class respresentation of a JSON-API error structure.
1113
*/

Classes/JSONAPIResourceParser.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ + (void)set:(NSObject <JSONAPIResource> *)resource withDictionary:dictionary {
205205

206206
} else {
207207
id value = [attributes objectForKey:[property jsonName]];;
208-
if (nil == value) {
208+
if ((id)[NSNull null] == value) {
209209
value = [dictionary objectForKey:[property jsonName]];
210210
}
211211

0 commit comments

Comments
 (0)