Non JSONAPI-compliant and download urls


#1

Hey guys!

I would like to have a clarification on how/where should be serialized urls that are not compliant to JSONAPI (legacy APIs) or download urls.

This is from the spec:

Links
Where specified, a links member can be used to represent links.

The spec is not very clear as to what a “link” is or should be and if other keys than self and related are allowed. So I could not figure out if it is allowed to add these urls as a custom link as follow:

{
  "data":{
    "id": "1",
    "type": "user",
    "links": {
      "my_old_api_url": "http://www.example.com/old_api/user/1",
      "profile_picture": "http://www.example.com/pictures/100"
    }
  }  
}

I would be really thankful if you could clarify this as for now we serialize these urls within the meta objects but would rather do it in links if that’s allowed.


#2

Hey @groyoh,

Sorry for the delayed response.

For now, "meta" is your best bet. In the future, you’ll be able to use "links" to include custom links, but that isn’t supported just yet.