{"action":"created","issue":{"url":"https://api.github.com/repos/balderdashy/sails/issues/2427","labels_url":"https://api.github.com/repos/balderdashy/sails/issues/2427/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/sails/issues/2427/comments","events_url":"https://api.github.com/repos/balderdashy/sails/issues/2427/events","html_url":"https://github.com/balderdashy/sails/issues/2427","id":49740300,"number":2427,"title":"Create REST blueprint not returning full expected response.","user":{"login":"gotmikhail","id":356867,"avatar_url":"https://avatars.githubusercontent.com/u/356867?v=3","gravatar_id":"","url":"https://api.github.com/users/gotmikhail","html_url":"https://github.com/gotmikhail","followers_url":"https://api.github.com/users/gotmikhail/followers","following_url":"https://api.github.com/users/gotmikhail/following{/other_user}","gists_url":"https://api.github.com/users/gotmikhail/gists{/gist_id}","starred_url":"https://api.github.com/users/gotmikhail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gotmikhail/subscriptions","organizations_url":"https://api.github.com/users/gotmikhail/orgs","repos_url":"https://api.github.com/users/gotmikhail/repos","events_url":"https://api.github.com/users/gotmikhail/events{/privacy}","received_events_url":"https://api.github.com/users/gotmikhail/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-11-21T19:46:34Z","updated_at":"2015-05-29T13:32:35Z","closed_at":null,"body":"I noticed I was not getting the same response on a post as I was on a get. Specifically, associations.\r\n\r\nReferencing 'Create new record while associating w/ another new record'\r\nhttps://github.com/balderdashy/sails-docs/blob/master/reference/blueprint-api/Create.md\r\n\r\nI recreate the scenario from the documentation with `sails new testProj`, then `sails generate api pony` and `sails generate api pet`, then update the models to have a one-to-one association.\r\n\r\nPony\r\n```javascript\r\nmodule.exports = {\r\n    attributes: {\r\n        pet: {\r\n            model: 'pet'\r\n        }\r\n    }\r\n};\r\n```\r\nPet\r\n```javascript\r\nmodule.exports = {\r\n    attributes: {\r\n        pony: {\r\n            model: 'pony'\r\n        }\r\n    }\r\n};\r\n```\r\nThen, `sails lift` away.\r\n\r\n`POST /pony`\r\nJSON Req\r\n```javascript\r\n{\r\n  \"name\": \"Pinkie Pie\",\r\n  \"hobby\": \"ice skating\",\r\n  \"pet\": {\r\n    \"name\": \"Gummy\",\r\n    \"species\": \"crocodile\"\r\n  }\r\n}\r\n```\r\nJSON Res\r\n```javascript\r\n{\r\n  \"name\": \"Pinkie Pie\",\r\n  \"hobby\": \"ice skating\",\r\n  \"pet\": 1,\r\n  \"createdAt\": \"2014-11-21T19:18:09.161Z\",\r\n  \"updatedAt\": \"2014-11-21T19:18:09.161Z\",\r\n  \"id\": 1\r\n}\r\n```\r\nAs you can see, the `res`ponse did not include the full pet object, just its id. In the documentation, it shows the full object being returned.\r\n\r\nThe entries and the association were definitely created successfully, \r\n`GET - /pony/1`\r\n```javascript\r\n{\r\n  \"pet\": {\r\n    \"name\": \"Gummy\",\r\n    \"species\": \"crocodile\",\r\n    \"createdAt\": \"2014-11-21T19:18:09.157Z\",\r\n    \"updatedAt\": \"2014-11-21T19:18:09.157Z\",\r\n    \"id\": 1\r\n  },\r\n  \"name\": \"Pinkie Pie\",\r\n  \"hobby\": \"ice skating\",\r\n  \"createdAt\": \"2014-11-21T19:18:09.161Z\",\r\n  \"updatedAt\": \"2014-11-21T19:18:09.161Z\",\r\n  \"id\": 1\r\n}\r\n```\r\n\r\nIs this an error in documentation, or an error in code? Either way, is there a way we can specify that we want the associations to be returned?\r\n\r\nOne-to-one associations are just showing up as the linked id, many to many do not show up at all. I was looking into the `toObject()` function for `waterline` for another issue when I saw the `showJoins` option; it looks like it might be related to that."},"comment":{"url":"https://api.github.com/repos/balderdashy/sails/issues/comments/106803361","html_url":"https://github.com/balderdashy/sails/issues/2427#issuecomment-106803361","issue_url":"https://api.github.com/repos/balderdashy/sails/issues/2427","id":106803361,"user":{"login":"CWyrtzen","id":6864923,"avatar_url":"https://avatars.githubusercontent.com/u/6864923?v=3","gravatar_id":"","url":"https://api.github.com/users/CWyrtzen","html_url":"https://github.com/CWyrtzen","followers_url":"https://api.github.com/users/CWyrtzen/followers","following_url":"https://api.github.com/users/CWyrtzen/following{/other_user}","gists_url":"https://api.github.com/users/CWyrtzen/gists{/gist_id}","starred_url":"https://api.github.com/users/CWyrtzen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CWyrtzen/subscriptions","organizations_url":"https://api.github.com/users/CWyrtzen/orgs","repos_url":"https://api.github.com/users/CWyrtzen/repos","events_url":"https://api.github.com/users/CWyrtzen/events{/privacy}","received_events_url":"https://api.github.com/users/CWyrtzen/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T13:32:35Z","updated_at":"2015-05-29T13:32:35Z","body":"Is this still an issue?"}}