DS.JSONSerializer#extractPolymorphicRelationship()

extractPolymorphicRelationship (relationshipModelName, relationshipHash, relationshipOptions) Object Defined in addon/serializers/json.js:637 Returns a polymorphic relationship formatted as a JSON-API "relationship object". http://jsonapi.org/format/#document-resource-object-relationships relationshipOptions is a hash which contains more information about the polymorphic relationship which should be extracted: - resourceHash complete hash of the resource the relationship should be extracted

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#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#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#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.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.JSONAPISerializer#_normalizeResponse()

_normalizeResponse (store, primaryModelClass, payload, id, requestType, isSingle) Objectprivate Inherited from DS.JSONSerializer but overwritten in addon/serializers/json-api.js:227 Parameters: store DS.Store primaryModelClass DS.Model payload Object id String|Number requestType String isSingle Boolean Returns: Object JSON-API Document

DS.JSONAPISerializer#_normalizeResourceHelper()

_normalizeResourceHelper (resourceHash) Objectprivate Defined in addon/serializers/json-api.js:167 Parameters: resourceHash Object Returns: Object