{"action":"closed","issue":{"url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/387","labels_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/387/labels{/name}","comments_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/387/comments","events_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/387/events","html_url":"https://github.com/samselikoff/ember-cli-mirage/issues/387","id":116608702,"number":387,"title":"Serializers can't actually control serialization","user":{"login":"ef4","id":319282,"avatar_url":"https://avatars.githubusercontent.com/u/319282?v=3","gravatar_id":"","url":"https://api.github.com/users/ef4","html_url":"https://github.com/ef4","followers_url":"https://api.github.com/users/ef4/followers","following_url":"https://api.github.com/users/ef4/following{/other_user}","gists_url":"https://api.github.com/users/ef4/gists{/gist_id}","starred_url":"https://api.github.com/users/ef4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ef4/subscriptions","organizations_url":"https://api.github.com/users/ef4/orgs","repos_url":"https://api.github.com/users/ef4/repos","events_url":"https://api.github.com/users/ef4/events{/privacy}","received_events_url":"https://api.github.com/users/ef4/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/milestones/1","html_url":"https://github.com/samselikoff/ember-cli-mirage/milestones/0.2.0","labels_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/milestones/1/labels","id":1054551,"number":1,"title":"0.2.0","description":"","creator":{"login":"samselikoff","id":2922250,"avatar_url":"https://avatars.githubusercontent.com/u/2922250?v=3","gravatar_id":"","url":"https://api.github.com/users/samselikoff","html_url":"https://github.com/samselikoff","followers_url":"https://api.github.com/users/samselikoff/followers","following_url":"https://api.github.com/users/samselikoff/following{/other_user}","gists_url":"https://api.github.com/users/samselikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/samselikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samselikoff/subscriptions","organizations_url":"https://api.github.com/users/samselikoff/orgs","repos_url":"https://api.github.com/users/samselikoff/repos","events_url":"https://api.github.com/users/samselikoff/events{/privacy}","received_events_url":"https://api.github.com/users/samselikoff/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":28,"state":"open","created_at":"2015-04-06T14:35:06Z","updated_at":"2016-01-06T13:14:06Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-11-12T18:19:12Z","updated_at":"2016-01-06T13:14:06Z","closed_at":"2016-01-06T13:14:06Z","body":"I'm seeing an architectural limitation with the current serializer API. Serializers don't actually get to control serialization -- there is a hard-coded `JSON.stringify` happening elsewhere. This makes it impossible to make an endpoint return any content type other than json.\r\n\r\nI would propose renaming the current `serialize` method to `toJSON`, and adding a new `serialize` method whose default implementation is `JSON.stringify(this.toJSON())`. This also depends on cleaning up the logic in serializer-registry that doesn't belong there and move it inside the toJSON methods of the existing serializers.\r\n"}}