{"action":"opened","issue":{"url":"https://api.github.com/repos/thisissoon/Flask-HAL/issues/2","labels_url":"https://api.github.com/repos/thisissoon/Flask-HAL/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/thisissoon/Flask-HAL/issues/2/comments","events_url":"https://api.github.com/repos/thisissoon/Flask-HAL/issues/2/events","html_url":"https://github.com/thisissoon/Flask-HAL/issues/2","id":99389030,"number":2,"title":"Document API","user":{"login":"krak3n","id":112322,"avatar_url":"https://avatars.githubusercontent.com/u/112322?v=3","gravatar_id":"","url":"https://api.github.com/users/krak3n","html_url":"https://github.com/krak3n","followers_url":"https://api.github.com/users/krak3n/followers","following_url":"https://api.github.com/users/krak3n/following{/other_user}","gists_url":"https://api.github.com/users/krak3n/gists{/gist_id}","starred_url":"https://api.github.com/users/krak3n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krak3n/subscriptions","organizations_url":"https://api.github.com/users/krak3n/orgs","repos_url":"https://api.github.com/users/krak3n/repos","events_url":"https://api.github.com/users/krak3n/events{/privacy}","received_events_url":"https://api.github.com/users/krak3n/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-06T08:53:20Z","updated_at":"2015-08-06T08:53:20Z","closed_at":null,"body":"We need to make it really simple to return `HAL` spec `JSON` documents.\r\n\r\nAll `HAL` responses at least should contain a `_links` object containing `self` link object:\r\n\r\n``` json\r\n{\r\n    \"_links\": {\r\n        \"self\": {\r\n            \"href\": \"/foo\"\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nIn which case it makes sense that the only required argument should be `links`. `data` and `embedded` should be key word arguments.\r\n\r\n``` python\r\nl = Links()\r\ndata = {'foo': 'bar'}\r\nd = Document(l, data=data, embedded=...)\r\n```\r\n\r\nBut really we should be able to create a document without anything and it automatically fill in the blanks as it's default behaviour.\r\n\r\n``` python\r\nd = Document()\r\n```\r\n\r\nThis would yield the default minimum HAL document. So all arguments would be optional.\r\n\r\nYou could then say:\r\n\r\n``` python\r\nd = Document()\r\nd.links.append(Link('next', '/?page=2'))\r\nd.data = {'foo': 'bar'}\r\nd.to_dict()\r\n```\r\n\r\nThoughts?"}}