Skip to content

Commit e91a03b

Browse files
committed
Expose initializer for Document.Body.Data
1 parent 82088c7 commit e91a03b

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Sources/JSONAPI/Document/Document.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ public struct Document<PrimaryResourceBody: JSONAPI.ResourceBody, MetaType: JSON
3939
public let includes: Includes<Include>
4040
public let meta: MetaType
4141
public let links: LinksType
42+
43+
public init(primary: PrimaryResourceBody, includes: Includes<Include>, meta: MetaType, links: LinksType) {
44+
self.primary = primary
45+
self.includes = includes
46+
self.meta = meta
47+
self.links = links
48+
}
4249
}
4350

4451
public var isError: Bool {

Sources/JSONAPI/Document/ResourceBody.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public struct NoResourceBody: ResourceBody {
3232
public static var none: NoResourceBody { return NoResourceBody() }
3333
}
3434

35-
// MARK: Decodable
35+
// MARK: Codable
3636
extension SingleResourceBody {
3737
public init(from decoder: Decoder) throws {
3838
let container = try decoder.singleValueContainer()

0 commit comments

Comments
 (0)