-
Notifications
You must be signed in to change notification settings - Fork 197
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
Deserialization does not work on repeated included relationships #173
Comments
This is a known issue with this repo but the author hasn't done anything to publicly address it. I forked this repo to fix this issue. You can view the PR here: And you can view my fork here: |
just ran into this issue. @AELSchauer I checked out your branch but it wasn't working for me |
I'm currently trying to reproduce this issue on my side and everything looks fine:
OUTPUT:
Any help to reproduce ? |
I have a pretty similar issue, but without null - it just does not include nested relationship for the second time - it's just omitted. It looks that as if it has already used it for the first time, and in the second time - it's not there. Reroducible code is here: |
Can confirm. Just spent ~6 hours figuring this out + 2 hours on adapting solution by @AELSchauer (thanks a lot!). Glad this issue was already pointed out or I'd have to spend even more time thinking I've gone mad 😄 Basically, having circular dependencies on your resources is not possible due to references evaluated as A simple example would be the following JSONAPI response: {
"data": {
"type": "product",
"id": "1",
"attributes": {
"name": "Product 1"
},
"relationships": {
"related": {
"data": [
{
"type": "product",
"id": "2"
}
]
}
}
},
"included": [
{
"type": "product",
"id": "2",
"attributes": {
"name": "Product 2"
},
"relationships": {
"related": {
"data": [
{
"type": "product",
"id": "1"
}
]
}
}
}
]
} 4e70016 without a patch produces following result: {
"name": "Product 1",
"id": "1",
"related": [
{
"name": "Product 2",
"id": "2",
"related": [
null
]
}
]
} Demonstration available here. |
Ancestry check based on type and id. Resolve SeyZ#173
If there are relationships that share resources, and are included only once each (see the example below - there are only two books but one is both a "selling" and a "favorite") when they are deserialized the second instance of the repeated relationship is not properly included (it just places null)
When deserialized, this returns
The text was updated successfully, but these errors were encountered: