Skip to content

GraphClient.DirectoryObjects.GetByIds throws JsonReaderError  #2759

@Helenyang2024

Description

@Helenyang2024

Describe the bug

When using GraphClient.DirectoryObjects.GetByIds with a principal ID of a custom role, the following JsonReaderError is thrown:
'{' is invalid after a value. Expected either ',', '}', or ']'. LineNumber: 0 | BytePositionInLine: 67041.

Expected behavior

Returns DirectoryObject for the existing list of ids

How to reproduce

var result = await this.GraphClient.DirectoryObjects.GetByIds.PostAsGetByIdsPostResponseAsync(
new Microsoft.Graph.Beta.DirectoryObjects.GetByIds.GetByIdsPostRequestBody
{
Ids = principalIds,
});

where principalIds include a guid id of a custom role assignment

SDK Version

No response

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions