1.4 KiB
1.4 KiB
Quickstart — Graph Contracts: LIST $expand Parity Fix
Goal
Verify that LIST requests can forward explicit, allowlisted $expand, and that the Entra Admin Roles report requests principal so it can render real principal display names.
Run tests (focused)
From repo root (Sail-first):
vendor/bin/sail artisan test --compact tests/Unit/GraphContractRegistryTest.phpvendor/bin/sail artisan test --compact tests/Unit/MicrosoftGraphClientListPoliciesSelectTest.phpvendor/bin/sail artisan test --compact --filter=EntraAdminRoles
Manual verification (developer)
- Ensure the
entraRoleAssignmentscontract includesallowed_expand => ['principal']. - Ensure the role assignment LIST request includes
$expand=principalwhen explicitly requested.
Usage examples
When listing a policy type where the contract allowlists principal:
listPolicies('entraRoleAssignments', [..., 'expand' => 'principal'])listPolicies('entraRoleAssignments', [..., 'expand' => ['principal']])
Normalization behavior:
expandstring input is split on top-level commas only (commas inside balanced parentheses are not separators) and trimmed.- Values not in the contract allowlist are dropped.
- Max 10 allowlisted expansions are sent; extras are dropped.
Notes
- No expansions are sent by default. Callers must pass
expandexplicitly. - Diagnostics are emitted when requested expands are removed or truncated.