DS.Serializer Class addon/serializer.js:7
DS.Serializer is an abstract base class that you should override in your
application to customize it for your backend. The minimum set of methods
that you should implement is:
And you can optionally override the following methods:
For an example implementation, see DS.JSONSerializer, the included JSON serializer.
normalize method is used to convert a payload received from your
external data source into the normalized form
store.push() expects. You
should override this method, munge the hash and return the normalized
- typeClass DS.Model
- hash Object
(store, primaryModelClass, payload, id, requestType)
normalizeResponse method is used to normalize a payload from the
server to a JSON-API Document.
- JSON-API Document
serialize method is used when a record is saved in order to convert
the record into the form that your external data source expects.
serialize takes an optional
options hash with a single option:
includeId: If this is
serializeshould include the ID in the serialized object it builds.
- record DS.Model
- options [Object]
store property is the application's
store that contains all records.
It's injected as a service.
It can be used to push records from a non flat data structure server