DS.JSONSerializer#extractRelationships()

extractRelationships (modelClass, resourceHash) Object Defined in addon/serializers/json.js:660 Returns the resource's relationships formatted as a JSON-API "relationships object". http://jsonapi.org/format/#document-resource-object-relationships Parameters: modelClass Object resourceHash Object Returns: Object

DS.JSONSerializer#extractMeta()

extractMeta (store, modelClass, payload) Defined in addon/serializers/json.js:1288 extractMeta is used to deserialize any meta information in the adapter payload. By default Ember Data expects meta information to be located on the meta property of the payload object. Example app/serializers/post.js import DS from 'ember-data'; export default DS.JSONSerializer.extend({ extractMeta: function(store, typeClass, payload) { if (payload && payload.hasOwnProperty('_pagination')) {

DS.JSONSerializer#extractErrors()

extractErrors (store, typeClass, payload, id) Object Defined in addon/serializers/json.js:1322 extractErrors is used to extract model errors when a call to DS.Model#save fails with an InvalidError. By default Ember Data expects error information to be located on the errors property of the payload object. This serializer expects this errors object to be an Array similar to the following, compliant with the JSON-API specification: { "errors": [ { "detail": "This username is alread

DS.JSONSerializer#extractAttributes()

extractAttributes (modelClass, resourceHash) Object Defined in addon/serializers/json.js:564 Returns the resource's attributes formatted as a JSON-API "attributes object". http://jsonapi.org/format/#document-resource-object-attributes Parameters: modelClass Object resourceHash Object Returns: Object

DS.JSONSerializer#extractId()

extractId (modelClass, resourceHash) String Defined in addon/serializers/json.js:550 Returns the resource's ID. Parameters: modelClass Object resourceHash Object Returns: String

DS.JSONSerializer

DS.JSONSerializer Class Extends: DS.Serializer Defined in: addon/serializers/json.js:19 Module: ember-data Ember Data 2.0 Serializer: In Ember Data a Serializer is used to serialize and deserialize records when they are transferred in and out of an external source. This process involves normalizing property names, transforming attribute values and serializing relationships. By default, Ember Data uses and recommends the JSONAPISerializer. JSONSerializer is useful for simpler or legacy back

DS.JSONSerializer#attrs

attrs{Object} Defined in addon/serializers/json.js:111 The attrs object can be used to declare a simple mapping between property names on DS.Model records and payload keys in the serialized JSON object representing the record. An object with the property key can also be used to designate the attribute's key on the response payload. Example app/models/person.js import DS from 'ember-data'; export default DS.Model.extend({ firstName: DS.attr('string'), lastName: DS.attr('string'), occu

DS.JSONSerializer#applyTransforms()

applyTransforms (typeClass, data) Objectprivate Defined in addon/serializers/json.js:175 Given a subclass of DS.Model and a JSON object this method will iterate through each attribute of the DS.Model and invoke the DS.Transform#deserialize method on the matching property of the JSON object. This method is typically called after the serializer's normalize method. Parameters: typeClass DS.Model data Object The data to transform Returns: Object data The transformed data object

DS.JSONAPISerializer#_normalizeRelationshipDataHelper()

_normalizeRelationshipDataHelper (relationshipDataHash) Objectprivate Defined in addon/serializers/json-api.js:138 Parameters: relationshipDataHash Object Returns: Object

DS.JSONAPISerializer#_normalizeDocumentHelper()

_normalizeDocumentHelper (documentHash) Objectprivate Defined in addon/serializers/json-api.js:103 Parameters: documentHash Object Returns: Object