microsoftgraph / microsoftgraph/msgraph-sdk-php

Support nested expansion deserialization - ex Read SharePoint List

Open
#381 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2 request: feature
Dominant language
PHP
Stars
669
Forks
150
Avg merge
15h 21m
Merged PRs (30d)
3

Description

Hi team,

I am a bit of a rookie but keen to see if this is an issue or if I am doing something wrong. I have searched everywhere but can't seem to find a solution so sorry if this is the wrong place to log this.

I am trying to read the data from a SharePoint list. It is working within the API explorer but not when I move it into PHP. In the API explorer I am hitting the below endpoint:

https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/?expand=columns,items(expand=columns)

When I do the below code in PHP it brings back the columns but the items are coming back in an empty array:

$list = $graph->createRequest("GET", "/sites/{site-id}/lists/{list-id}/?expand=columns,items(expand=columns)")
->setReturnType(Model\Site::class)
->execute();

Any help would be really appreciated!

Thanks

Sam
AB#7976

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the PHP createRequest call for /sites/{site-id}/lists/{list-id}/?expand=columns,items(expand=columns), using Model\Site::class as the return type, and compare it with the API Explorer response. Trace how nested items and their columns are deserialized, then verify that the returned items contain the expanded data rather than an empty array.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.