{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/data/issues/3417","labels_url":"https://api.github.com/repos/emberjs/data/issues/3417/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/data/issues/3417/comments","events_url":"https://api.github.com/repos/emberjs/data/issues/3417/events","html_url":"https://github.com/emberjs/data/issues/3417","id":90185068,"number":3417,"title":"JSON:API serializer: normalizeHash doesn't work","user":{"login":"kottenator","id":371674,"avatar_url":"https://avatars.githubusercontent.com/u/371674?v=3","gravatar_id":"","url":"https://api.github.com/users/kottenator","html_url":"https://github.com/kottenator","followers_url":"https://api.github.com/users/kottenator/followers","following_url":"https://api.github.com/users/kottenator/following{/other_user}","gists_url":"https://api.github.com/users/kottenator/gists{/gist_id}","starred_url":"https://api.github.com/users/kottenator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kottenator/subscriptions","organizations_url":"https://api.github.com/users/kottenator/orgs","repos_url":"https://api.github.com/users/kottenator/repos","events_url":"https://api.github.com/users/kottenator/events{/privacy}","received_events_url":"https://api.github.com/users/kottenator/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-22T19:14:19Z","updated_at":"2015-06-22T21:44:30Z","closed_at":null,"body":"It seems that `normalizeHash` doesn't work in `JSONAPISerializer`\r\n\r\nI use `ember-data#canary` (commit 4c5fcf6)\r\n\r\nHere is my example: \r\n\r\n```json\r\n// JSON API data\r\n{\r\n    \"data\": [\r\n        {\r\n            \"type\": \"member\",\r\n            \"id\": \"176a71f3397643e08a4bfd25ba75f41b\",\r\n            \"relationships\": {\r\n                \"user\": {\r\n                    \"data\": {\r\n                        \"type\": \"user\",\r\n                        \"id\": \"1e4b1262b98740ddade68f7a61e6730e\"\r\n                    },\r\n                    \"meta\": {\r\n                        \"title\": \"Selena Whitaker\",\r\n                        \"email\": \"selena.whitaker@veraq.io\"\r\n                    }\r\n                }\r\n            }\r\n        }\r\n    ]\r\n}\r\n```\r\n\r\n```js\r\n// app/models/member.js\r\nimport DS from 'ember-data';\r\n\r\nexport default DS.Model.extend({\r\n    fullName: DS.attr('string'),\r\n    email: DS.attr('string')\r\n});\r\n\r\n```\r\n\r\n```js\r\n// app/serializers/application.js\r\nimport DS from 'ember-data';\r\n\r\nexport default DS.JSONAPISerializer.extend({\r\n    normalizeHash: {\r\n        member(hash) {\r\n            hash.fullName = hash.relationships.user.meta.title;\r\n            hash.email = hash.relationships.user.meta.email;\r\n            return hash;\r\n        }\r\n    }\r\n});\r\n```\r\n\r\nIn this example, `normalizeHash.member(...)` isn't triggered (but it works in `RESTSerializer`). Shouldn't it work in `JSONAPISerializer`?\r\n\r\nI could override `normalize(...)` method and manually call `normalizeHash.member(...)` but it doesn't seem right"},"comment":{"url":"https://api.github.com/repos/emberjs/data/issues/comments/114272561","html_url":"https://github.com/emberjs/data/issues/3417#issuecomment-114272561","issue_url":"https://api.github.com/repos/emberjs/data/issues/3417","id":114272561,"user":{"login":"wecc","id":708205,"avatar_url":"https://avatars.githubusercontent.com/u/708205?v=3","gravatar_id":"","url":"https://api.github.com/users/wecc","html_url":"https://github.com/wecc","followers_url":"https://api.github.com/users/wecc/followers","following_url":"https://api.github.com/users/wecc/following{/other_user}","gists_url":"https://api.github.com/users/wecc/gists{/gist_id}","starred_url":"https://api.github.com/users/wecc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wecc/subscriptions","organizations_url":"https://api.github.com/users/wecc/orgs","repos_url":"https://api.github.com/users/wecc/repos","events_url":"https://api.github.com/users/wecc/events{/privacy}","received_events_url":"https://api.github.com/users/wecc/received_events","type":"User","site_admin":false},"created_at":"2015-06-22T21:44:30Z","updated_at":"2015-06-22T21:44:30Z","body":"The `normalize` function in `app/serializers/member.js` will only be called with a payload for a Member resource.\r\n\r\nIf you want everything in the same place, in the application serializer, you can implement your own `normalizeHash` based on `modelName` (like in your second comment)."}}