Class DS.Serializer

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:

  • extract()
  • serialize()

And you can optionally override the following methods:

  • normalize()

For an example implementation, see DS.JSONSerializer, the included JSON serializer.

Show:

Module: ember-data
store
DS.Store
typeClass
DS.Model
payload
Object
id
(String|Number)
requestType
String
returns
Object

The extract method is used to deserialize the payload received from your data source into the form that Ember Data expects.

Module: ember-data
typeClass
DS.Model
hash
Object
returns
Object

The 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 payload.

Module: ember-data
record
DS.Model
options
Object
returns
Object

The 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 true, serialize should include the ID in the serialized object it builds.