If I have a field that in the case of a snake returns from api, how can I define this field in the model? I am using JSONAPIAdapter. Fields seem to be one word that works great, but snake case fields return as undefined.
This is how I defined it 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 here is how json returns from the API:
1: {
id: "96"
type: "contact_infos"
attributes: {
typecode_desc: "E-mail address"
contactnum: "billybear@yahoo.com"
email: 1
}
}
However, in the ember inspector, it typecode_descreturns as undefined. Is there something I need to do to tell ember that the fields will return as is the case with a snake?
source
share