You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
struct Dog: JSONAPIEntity {
let id: String
let name: String
let cat: Cat?
}
struct Cat: JSONAPIEntity {
let id: String
let name: String
}
struct User: JSONAPIEntity {
let id: String
let name: String
let dog: Dog
let cats: [Cat]
}
And the serialization:
let cats = [Cat(id: "33", name: "Stancho"), Cat(id: "44", name: "Hez")]
let dog = Dog(id: "22", name: "Joan", cat: Cat(id: "55", name: "Max"))
let user = User(id: "11", name: "Alex", dog: dog, cats: cats)
JSONAPISerializer(user, includingChildren: true)
So this should be fixed on JSONAPISerializable's func includedRelationships(includingChildren: Bool, transformingKeys keyTransformer: KeyTransformer?) -> [Any]?
The text was updated successfully, but these errors were encountered:
Given this model:
And the serialization:
What we get back is the following JSON:
Where the dog object in
included
is missing hisrelationships
attributes, so should be like:So this should be fixed on
JSONAPISerializable
'sfunc includedRelationships(includingChildren: Bool, transformingKeys keyTransformer: KeyTransformer?) -> [Any]?
The text was updated successfully, but these errors were encountered: