home
  • Blog
  • Home
  • Projects
    • Ember
    • EmberData
    • Ember CLI
1.13
  • Packages
    • ember-data
  • Namespaces
    • DS
    • Ember.Date
  • Classes
    • DS.AbortError
    • DS.ActiveModelAdapter
    • DS.ActiveModelSerializer
    • DS.Adapter
    • DS.AdapterError
    • DS.AdapterPopulatedRecordArray
    • DS.BooleanTransform
    • DS.BuildURLMixin
    • DS.DateTransform
    • DS.EmbeddedRecordsMixin
    • DS.Errors
    • DS.FilteredRecordArray
    • DS.FixtureAdapter
    • DS.InternalModel
    • DS.InvalidError
    • DS.JSONAPIAdapter
    • DS.JSONAPISerializer
    • DS.JSONSerializer
    • DS.ManyArray
    • DS.Model
    • DS.NumberTransform
    • DS.PromiseArray
    • DS.PromiseManyArray
    • DS.PromiseObject
    • DS.RESTAdapter
    • DS.RESTSerializer
    • DS.RecordArray
    • DS.RootState
    • DS.Serializer
    • DS.Store
    • DS.StringTransform
    • DS.TimeoutError
    • DS.Transform

Class DS.Serializer


Extends: Ember.Object
Defined in: packages/ember-data/lib/system/serializer.js:5
Module: ember-data

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.


Methods

extract (store, typeClass, payload, id, requestType) : Object

Module: ember-data

Defined in packages/ember-data/lib/system/serializer.js:63

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.

normalize (typeClass, hash) : Object

Module: ember-data

Defined in packages/ember-data/lib/system/serializer.js:93

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.

serialize (record, options) : Object

Module: ember-data

Defined in packages/ember-data/lib/system/serializer.js:77

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.

Properties

store public

Module: ember-data

Defined in packages/ember-data/lib/system/serializer.js:52

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

On this page


Methods

  • extract
  • normalize
  • serialize

Properties

  • store
Team Sponsors Security Legal Branding Community Guidelines
Twitter GitHub Discord Mastodon

If you want help you can contact us by email, open an issue, or get realtime help by joining the Ember Discord.

© Copyright 2025 - Tilde Inc.
Ember.js is free, open source and always will be.


Ember is generously supported by
blue Created with Sketch.