Ember-data serializers are the tool for transforming your API's representation of data into what your ember app expects. We'll examine several common use cases for massaging JSON, including:
- changing the names of properties
- normalizing property key format
- synthesizing client-side IDs
Massaging JSONBuilt-In Serializers
Ember-data ships with the following types of serializers:
and optionally, by way of an officially-supported addon
We'll study each of these, and explore the kinds of JSON they're designed to work with.
Massaging JSONFunctional JSON Massaging
Massaging JSONExercise: Building Serializers for Awful JSON
I've added some new features to the apps we wrote adapters for, earlier today. The JSON for these new records doesn't align well with what ember-data expects to see by default. Split up into teams, and work together to massage this JSON until all tests pass. Each group will present their solution to the rest of the workshop.