We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
id
1 parent d3666e6 commit 3b0e7a0Copy full SHA for 3b0e7a0
Sources/JSONAPIMapper/Models/Resource.swift
@@ -22,7 +22,7 @@ public struct Resource: JSONAPICodable {
22
23
public init(from decoder: Decoder) throws {
24
let container = try decoder.container(keyedBy: CodingKeys.self)
25
- id = try container.decode(String.self, forKey: .id)
+ id = (try? container.decode(String.self, forKey: .id)) ?? ""
26
type = try container.decode(String.self, forKey: .type)
27
attributes = try container.decodeIfPresent(JSON.self, forKey: .attributes)
28
relationships = try container.decodeIfPresent([String: Relationship].self, forKey: .relationships)
0 commit comments