diff --git a/addon/serializers/json.js b/addon/serializers/json.js index 6d45fe10604..5de6c37f478 100644 --- a/addon/serializers/json.js +++ b/addon/serializers/json.js @@ -705,6 +705,17 @@ const JSONSerializer = Serializer.extend({ } relationship = { data }; } + + let linkKey = this.keyForLink(key, relationshipMeta.kind); + if (resourceHash.links && resourceHash.links[linkKey] !== undefined) { + let related = resourceHash.links[linkKey]; + relationship = relationship || {}; + relationship.links = { related }; + } + + if (relationship) { + relationships[key] = relationship; + } }); return relationships;