-
Notifications
You must be signed in to change notification settings - Fork 37
Error thrown when relationship is not registered #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Should be fixed by #126 |
@danivek I don't think so. In my example the author relationship is not registrered. In his example it is. I haven't looked into the code just now, but I do remember several tests failing when I created a similar fix. Can you reopen the issue? As I mentioned I'm happy to create a fix, given how you want it to work. |
Edit: @Istanful I tried with your unit test and now with master/2.6.4, the error returned is now You are right, in your case another error should be thrown, indicating that the relationship has not been defined I reopen the issue. |
@Istanful To avoid breaking things actually, what about not throwing error and trying to deserialize with the given type if it is registered ? The same behavior as if there is no |
@danivek Sure. If you think that's the more correct behaviour then I think avoiding breakage is a good idea. 👍 😄 |
Description
When a resource is deserialized and the included relationship is not registered an error will be thrown. The error says
Cannot read property 'schema' of undefined
, which does not help a whole lot to troubleshoot.To help the user my suggestion is to throw an error saying:
This would break backwards compability though, since some tests will fail.
What is the desired behavior here? I'm happy to patch it given how you want it to work.
Here's a test to reproduce:
The text was updated successfully, but these errors were encountered: