-
Notifications
You must be signed in to change notification settings - Fork 152
Closed
Description
When requesting a collection that returns an empty result the result is actually parsed to an object that was given in the ReturnType.
Example:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.plannerPlan)",
"@odata.count": 0,
"value": []
}
Results in
object(Microsoft\Graph\Model\PlannerPlan)[400]
protected '_propDict' =>
array (size=3)
'@odata.context' => string 'https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.plannerPlan)' (length=82)
'@odata.count' => int 0
'value' =>
array (size=0)
empty
I think the system should handle this as an empty array. The problem can be found in the class \Microsoft\Graph\Http\GraphResponse - method getResponseAsObject - line 152 where the system checks if the variable '$values' is available. When given an empty array the system returns false and continues to parse the collection as an object, returning false results.