Xcode is a mess when editing userinfo in Data Model. I rather add userinfo only when it is needed than add for all properties. So it was easier to match the property names to our API response and add JSONKeyPath for those that didn't match. So the end results was that only id key needed to be updated on all models and some relationship keys.
Our API follows JSON-API standards so JSON can include links.users : [array_of_ids]. It meant I had to normalize the data after the response was received which was just a problem of big O. So instead I have added provisions in the code to allow JSONKeyPath to be a path to the object. So in our case users relationship has JSONKeyPath of links.users which means no more normalizing the data!
Xcode is a mess when editing userinfo in Data Model. I rather add userinfo only when it is needed than add for all properties. So it was easier to match the property names to our API response and add JSONKeyPath for those that didn't match. So the end results was that only
id
key needed to be updated on all models and some relationship keys.Our API follows JSON-API standards so JSON can include
links.users : [array_of_ids]
. It meant I had to normalize the data after the response was received which was just a problem of big O. So instead I have added provisions in the code to allow JSONKeyPath to be a path to the object. So in our caseusers
relationship has JSONKeyPath oflinks.users
which means no more normalizing the data!