{"action":"opened","issue":{"url":"https://api.github.com/repos/marshmallow-code/marshmallow-jsonapi/issues/17","labels_url":"https://api.github.com/repos/marshmallow-code/marshmallow-jsonapi/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/marshmallow-code/marshmallow-jsonapi/issues/17/comments","events_url":"https://api.github.com/repos/marshmallow-code/marshmallow-jsonapi/issues/17/events","html_url":"https://github.com/marshmallow-code/marshmallow-jsonapi/issues/17","id":117237779,"number":17,"title":"Missing support for \"links\" object","user":{"login":"erickt","id":84711,"avatar_url":"https://avatars.githubusercontent.com/u/84711?v=3","gravatar_id":"","url":"https://api.github.com/users/erickt","html_url":"https://github.com/erickt","followers_url":"https://api.github.com/users/erickt/followers","following_url":"https://api.github.com/users/erickt/following{/other_user}","gists_url":"https://api.github.com/users/erickt/gists{/gist_id}","starred_url":"https://api.github.com/users/erickt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erickt/subscriptions","organizations_url":"https://api.github.com/users/erickt/orgs","repos_url":"https://api.github.com/users/erickt/repos","events_url":"https://api.github.com/users/erickt/events{/privacy}","received_events_url":"https://api.github.com/users/erickt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-16T22:50:51Z","updated_at":"2015-11-16T22:50:51Z","closed_at":null,"body":"`marshmallow-jsonapi` is great, but it appears to be missing support for the [document links object](http://jsonapi.org/format/#document-links). I've hacked this into a schema with:\r\n\r\n```python\r\nclass JiraSchema(Schema):\r\n  def get_links(self, item):\r\n    return {\r\n      'self': api.url_for(Jira, jira_id=item['id'], _external=True),\r\n    }\r\n\r\n  def format_items(self, item, many):\r\n    ret = super(JiraSchema, self).format_items(item, many)\r\n    if many:\r\n      for doc in ret:\r\n        doc['links'] = self.get_links(doc)\r\n\r\n    return ret\r\n\r\n  def get_top_level_links(self, data, many):\r\n    if many:\r\n      self_link = api.url_for(Jiras, _external=True)\r\n    else:\r\n      self_link = api.url_for(Jira, jira_id=data['id'], _external=True)\r\n\r\n    return { 'self': self_link }\r\n```\r\n\r\nBut it'd be nice if there was formal support for it."}}