Serializers

When data comes in and goes out, the JSON structure is serialized and deserialized. The adapter uses the serializer to get the data in and out of the store to build and resolve request/response data.

You can create a serializer with ember g serializer [application or model name], which will create a serializer file with boilerplate code, like this:

import DS from 'ember-data';

export default DS.JSONAPISerializer.extend({
});

The serializer is an object assigned to the serializer property in the adapter. Without a specific serializer file in your application, Ember will use a default adapter and serializer, the JSONAPIAdapter and JSONAPISerializer.

When you include a new serializer for the application, that serializer ...

Get Front-End Web Development: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.