-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
BelongsTo relation called 'type' in combination with a link returns error #3784
Comments
Nobody? |
@jevanlingen can you confirm that #3814 solves your issue, so this one can be closed? |
won der ful! Good to hear! ✨ |
I still face one problem with the But today I noticed the related link does not work. The serializer should return something like this for an async relation according to the JSON API spec: data: {
id: "something",
... // other props
relationships: {
type: {
links: {
related: "link-to-another-system"
}
}
}
} For every other attribute name the JSONSerializer does just that! But in case the data: {
id: "something",
... // other props
relationships: {
type: {
date: {
id: "something",
type: "associated-related-model" //in my case 'file-type'
}
}
}
} This is plainly wrong, the JSONSerializer ignores the links property! |
Can you create an ember-twiddle demonstrating the issue you're having? You can use this as a starting point... |
I was wrong about this. After creating the Twiddle, I understood my problem was of a different kind. The |
Today I was updating Ember Data from 1.13.8 to 1.13.13. As #3725, the
type
attribute can be used again. My case is a little different, as I have a belongs-to relation. This still shouldn't be a problem as @tschoartschi in ticket #3769 also has atype
belongs-to relation and the fix worked for him.I got following file model:
The type property belongs to a
file-type
model, which is loaded async with an own given link. So I made a file serializer:Yet, I still seem to face a problem regarding the
type
property. Pull #3725 just fixes the problem for attributes (by adding theprimaryHasTypeAttribute
variable).Maybe my own serializer is the problem, but
returns
undefined
for me. I find that logicly, as a belong-to relation is not a attribute (to be honest I don't understand how it's possible pull #3725 fixes #3769).Whaterever the case. if a set
primaryHasTypeAttribute
totrue
by hand, the problem is solved! Maybe the check should also take relation properties into account?The text was updated successfully, but these errors were encountered: