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
According to the JSON:API documentation, when requesting a nested include such as destination.location for a stop resource, if the stop does not have a destination attached to it, the response should return destination=null instead of breaking with an error.
Steps to Reproduce:
Create a resource location.
Create a resource destination with nullable relationship location.
Create a resource stop with nullable relationship destination.
Request the stop resource with the include destination.location.
(Ensure that the stop resource does not have a destination attached)
cube-dainis
changed the title
Breaks when trying to access subresource of nulled resource
Incorrect Handling of Nested Includes for Missing Relationships
Jan 13, 2025
Description:
According to the JSON:API documentation, when requesting a nested include such as
destination.location
for astop
resource, if thestop
does not have adestination
attached to it, the response should returndestination=null
instead of breaking with an error.Steps to Reproduce:
location
.destination
with nullable relationshiplocation
.stop
with nullable relationshipdestination
.stop
resource with the includedestination.location
.(Ensure that the
stop
resource does not have adestination
attached)Expected Behavior:
The response should include:
Actual Behavior:
The request fails with an error due to the missing
destination
resource ($this->resource):Linked Pull Request:
PR: #70
The text was updated successfully, but these errors were encountered: