Description:
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)
Expected Behavior:
The response should include:
"relationships": {
"destination": {
"data": null
}
}
Actual Behavior:
The request fails with an error due to the missing destination resource ($this->resource):
ErrorException: Attempt to read property \"location\" on null
Linked Pull Request:
PR: #70
Description:
According to the JSON:API documentation, when requesting a nested include such as
destination.locationfor astopresource, if thestopdoes not have adestinationattached to it, the response should returndestination=nullinstead of breaking with an error.Steps to Reproduce:
location.destinationwith nullable relationshiplocation.stopwith nullable relationshipdestination.stopresource with the includedestination.location.(Ensure that the
stopresource does not have adestinationattached)Expected Behavior:
The response should include:
Actual Behavior:
The request fails with an error due to the missing
destinationresource ($this->resource):Linked Pull Request:
PR: #70