V3 API doesn't return any of the records more than 2 times. If a record
is already included in the response any other occurences will be
represented as a reference, ie. a hash with just an @href. Ember Data
doesn't play nice with such references as it needs an id to identify a
record.
The code in this commit traverses payloads from V3 API and adds an id to
each of the references that are present.
For example a following payload:
{
"@href": "/build/1",
"@type": "build"
"id": 1,
"state": "passed",
"branch": {
"@href": "/repo/1/branch/master",
"name": "master",
"lastBuild": {
"@href": "/build/1"
}
}
}
Will be changed to:
{
"@href": "/build/1",
"@type": "build"
"id": 1,
"state": "passed",
"branch": {
"@href": "/repo/1/branch/master",
"name": "master",
"lastBuild": {
"@href": "/build/1",
"id": 1
}
}
}
In this case an "id" field was added to "branch.lastBuild" field.