Open SashaUsov opened 1 month ago
Make some additional queries:
"*"
:
graphServiceClient.sites()
.get(requestConfiguration -> {
var queryParameters = requestConfiguration.queryParameters;
queryParameters.select = new String[]{SELECT_SITE_NAME};
queryParameters.search = "*";
})
.getValue()
com.microsoft.graph.models.odataerrors.ODataError: Syntax error: character '*' is not valid at position 0 in '*'.
""
:
graphServiceClient.sites()
.get(requestConfiguration -> {
var queryParameters = requestConfiguration.queryParameters;
queryParameters.select = new String[]{SELECT_SITE_NAME};
queryParameters.search = "";
})
.getValue()
com.microsoft.graph.models.odataerrors.ODataError: Expression expected at position 0 in ''.
"all"
:
graphServiceClient.sites()
.get(requestConfiguration -> {
var queryParameters = requestConfiguration.queryParameters;
queryParameters.select = new String[]{SELECT_SITE_NAME};
queryParameters.search = "all";
})
.getValue()
Java SDK v5.80.0 request with same client_id and user:
graphServiceClient
.sites()
.buildRequest(new QueryOption("search", "*"), new QueryOption("select", "id,name"))
.get()
.getCurrentPage()
Work solution: https://github.com/microsoftgraph/msgraph-sdk-java/issues/2090#issuecomment-2390888773
Please tell me, will this bug be fixed in the next SDK releases?
@SashaUsov this will need to be prioritized against other issues. For now, it's likely that it won't make it into the next release. I'm also unable to reproduce the behaviour and would need further investigation here.
In the meantime, using withUrl()
should help until this is resolved.
Describe the bug
Create GraphServiceClient with UsernamePasswordCredential provider
Call graphClient.sites().get().getValue()
Expected result: receive a list of the sites Actual result: an empty list was returned without any error.
GraphServiceClient with ClientSecretCredential provider works as expected on graphClient.sites().get().getValue() call.
SDK Version
6.16.0