I\'m consuming a web service that in POST/PUT verbs expects a JSON like this:
{
\"id\":\"CACTU\",
\"companyName\": \"Cactus Comidas para llevar\",
\
You'll want to override one of the serialize methods, I think serializeIntoHash might work:
App.CustomerSerializer = DS.RESTSerializer.extend({
serializeIntoHash: function(hash, type, record, options) {
Ember.merge(hash, this.serialize(record, options));
}
});
This is instead of the normal serializeIntoHash which looks like this:
serializeIntoHash: function(hash, type, record, options) {
hash[type.typeKey] = this.serialize(record, options);
}
Additional documentation can be found here:
https://github.com/emberjs/data/blob/v2.1.0/packages/ember-data/lib/serializers/rest-serializer.js#L595