Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphClient.DirectoryObjects.GetByIds throws JsonReaderError #2759

Open
Helenyang2024 opened this issue Nov 20, 2024 · 1 comment
Open

GraphClient.DirectoryObjects.GetByIds throws JsonReaderError #2759

Helenyang2024 opened this issue Nov 20, 2024 · 1 comment
Labels
status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:bug A broken experience

Comments

@Helenyang2024
Copy link

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_
@Helenyang2024 Helenyang2024 added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Nov 20, 2024
@timayabi2020 timayabi2020 transferred this issue from microsoftgraph/msgraph-sdk-powershell Nov 27, 2024
@timayabi2020 timayabi2020 transferred this issue from microsoftgraph/msgraph-beta-sdk-dotnet Nov 27, 2024
@andrueastman
Copy link
Member

Thanks for raising this @Helenyang2024

The error would suggest an issue with json body that is returned from the API. Are you able to share the version of the SDK you are using when making this call?

Are you also able to follow the guidance below to capture the response body to help validate if the json is indeed invalid?
https://github.com/microsoftgraph/msgraph-sdk-dotnet-core/blob/main/docs/logging-requests.md

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants