File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ extension JSONAPIDecoder {
129129 private func getResource( from includedDictionary: ResourceDictionary ,
130130 for identifier: ResourceIdentifier ) throws -> Resource {
131131 guard let resource = includedDictionary [ identifier] else {
132- throw Errors . JSONAPIDecodingError . resourceNotFound ( identifier: identifier)
132+ return Resource ( id : identifier. id , type : identifier. type )
133133 }
134134 return resource
135135 }
Original file line number Diff line number Diff line change @@ -29,4 +29,13 @@ public struct Resource: JSONAPICodable {
2929 links = try container. decodeIfPresent ( Links . self, forKey: . links)
3030 meta = try container. decodeIfPresent ( JSON . self, forKey: . meta)
3131 }
32+
33+ init ( id: String , type: String ) {
34+ self . id = id
35+ self . type = type
36+ self . attributes = nil
37+ self . relationships = nil
38+ self . links = nil
39+ self . meta = nil
40+ }
3241}
You can’t perform that action at this time.
0 commit comments