data
data copied to clipboard
Confusing error message inside record-data.ts
Passing improper payloads sometimes results in error messages that look like:
Assertion Failed: Encountered a relationship identifier without a type for the hasMany relationship 'zones' on <scheme:8e11d4ae-e361-43df-8fc3-d0f44a638937>, expected a json-api identifier with type 'zone' but found {big object definition}
This has at least two issues:
- It refers to json-api, even though it's inside record-data and the user could be using a different serializer
- The object dump is not useful
The object dump should stringify nicely, that it's not is definitely a bug (we set it up for them to stringify nicely in DEBUG but not prod).
Referring to JSON:API is intentional as by this point the format must be JSON:API. It doesn't matter what serializer base class you've extended. Hiding this from the end-user only creates unneeded confusion about how serializers work, which is why the newer API docs attempt to make it very clear that normalized data must be JSON:API. https://api.emberjs.com/ember-data/release/modules/@ember-data%2Fserializer