Hi,
One of our incoming only datasources delivers a single, large, deeply nested payload. By Chaining together RESTSerializers and using the EmbeddedRecordsMixin I create a a series of models with the required nested relationships. This data is constantly refreshed and we poll the endpoint at various intervals. I would like to write the resulting models into firebase.
Unfortunately when trying to save to firebase, the RESTSerializer used to generate these models is being used to save the models instead of expected firebase Serializer. The RESTSerializer seems to includes properties with a value of "undefined" which Firebase rejects before trying to save.
I am looking for advice and/or options. Here is what I have come up with in order of preference
- Before saving tell the FirebaseAdapter to use the FiresbaseSerializer instead of the models defined RESTSerializer.
Can this be done?
- Update the models existing RESTSerializers to avoid the "undefined" values (unsure if other problems may arise).
- Push the raw data from the endpoint into firebase and rewrite the collection of existing RESTSerializers using the standard FirebaseSerializer. (time consuming).
- Update the existing datasource's normalizeResponse to produce content that can be consumed by a FirebaseSerailizer, and use FirebaseSerailizers for the nested models, (also time consuming)
The resulting models contain a total of 3000 rows spread across 4 related models.
Thanks!