mirror of
https://github.com/encounter/JSONAPI.git
synced 2026-03-30 11:18:38 -07:00
A little renaming and easier access to important types under the JSONAPIDocument protocol
This commit is contained in:
@@ -47,3 +47,13 @@ if case let .data(bodyData) = peopleResponse.body {
|
||||
} else {
|
||||
print("no body data")
|
||||
}
|
||||
|
||||
// MARK: - Work in the abstract
|
||||
|
||||
func process<T: JSONAPIDocument>(document: T) {
|
||||
guard case let .data(body) = document.body else {
|
||||
return
|
||||
}
|
||||
let x: T.BodyData = body
|
||||
}
|
||||
process(document: peopleResponse)
|
||||
|
||||
Reference in New Issue
Block a user