You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the old REST API, if a model has an attribute named type which can have a value that matches the name of another model, then the model instance may be loaded with the wrong model.
_normalizePolymorphicRecord tries to detect if a payload is using JSON API or REST API, by checking if the hash has a type attribute that matches a model name. But, it is possible for this to occur when using the REST API as well. So, payloads from the REST API are sometimes erroneously parsed as JSON API payloads, causing them to be loaded into the store with the wrong model.
Since I don't use the JSON API, I have worked around this issue in my application by adding the below to my application serializer.
I am using ember-data 2.0.0
When using the old REST API, if a model has an attribute named type which can have a value that matches the name of another model, then the model instance may be loaded with the wrong model.
_normalizePolymorphicRecord tries to detect if a payload is using JSON API or REST API, by checking if the hash has a type attribute that matches a model name. But, it is possible for this to occur when using the REST API as well. So, payloads from the REST API are sometimes erroneously parsed as JSON API payloads, causing them to be loaded into the store with the wrong model.
Since I don't use the JSON API, I have worked around this issue in my application by adding the below to my application serializer.
The text was updated successfully, but these errors were encountered: