dimanche 12 août 2018

Ember - different keys for serialization and deserialization

I have an issue where an property needs to be serialized and deserialized using to different keys.

In the serializer, the property addresses the key trade:

'tradeId': { key: 'trade' },

This works when addressing the deserialization endpoint.

However, for serialization, the endpoint property is called trade-identifier, requiring the serializer reference to be changed to the following:

'tradeId': { key: 'tradeIdentifier' },

Is there any way to define seperate keys for serialization and deserialization in an Ember serializer?




Aucun commentaire:

Enregistrer un commentaire