File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,7 @@ + (void)set:(NSObject <JSONAPIResource> *)resource withDictionary:dictionary {
180
180
181
181
NSDictionary *relationships = [dictionary objectForKey: @" relationships" ];
182
182
NSDictionary *attributes = [dictionary objectForKey: @" attributes" ];
183
+ NSDictionary *links = [dictionary objectForKey: @" links" ];
183
184
184
185
id ID = [dictionary objectForKey: @" id" ];
185
186
NSFormatter *format = [descriptor idFormatter ];
@@ -192,11 +193,9 @@ + (void)set:(NSObject <JSONAPIResource> *)resource withDictionary:dictionary {
192
193
[resource setValue: ID forKey: [descriptor idProperty ]];
193
194
}
194
195
195
- if (dictionary[@" links" ]) {
196
- if (descriptor.selfLinkProperty ) {
197
- NSString *selfLink = dictionary[@" links" ][@" self" ];
198
- [resource setValue: selfLink forKey: descriptor.selfLinkProperty];
199
- }
196
+ if (descriptor.selfLinkProperty ) {
197
+ NSString *selfLink = links[@" self" ];
198
+ [resource setValue: selfLink forKey: descriptor.selfLinkProperty];
200
199
}
201
200
202
201
// Loops through all keys to map to properties
You can’t perform that action at this time.
0 commit comments