If I have a field that is in snake case coming back from the api, how should I define that field in the model? Im using the JSONAPIAdapter. It seems like fields that is one word work fine, but snake case fields come back as undefined.
This is how I have it defined in my model:
import DS from 'ember-data';
export default DS.Model.extend({
typecode_desc: DS.attr('string'),
contactnum: DS.attr('string'),
email: DS.attr('number'),
individual: DS.belongsTo('individual', {async: false})
});
And this is how the json comes back from the API:
1: {
id: "96"
type: "contact_infos"
attributes: {
typecode_desc: "E-mail address"
contactnum: "[email protected]"
email: 1
}
}
However, in the ember inspector, typecode_desc
comes back as being undefined. Is there something I need to do to tell ember that fields will come back as being snake case?