microsoftgraph / microsoftgraph/msgraph-sdk-java

Site `search` query parameter is inconsistent between SDK and Graph Explorer

Open
#2,346 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:waiting-for-triage type:bug
Dominant language
Java
Stars
444
Forks
154
Avg merge
18h 28m
Merged PRs (30d)
4

Description

Describe the bug

When using Graph Explorer, the API endpoint https://graph.microsoft.com/v1.0/sites returns nothing.

With Graph Explorer, it appears that using ?search=* works to return all sites.

When using the SDK, the same endpoint returns sites, and specifying queryParameters.search = "*" throws:

Syntax error: character '*' is not valid at position 0 in '*'.
com.microsoft.graph.models.odataerrors.ODataError: Syntax error: character '*' is not valid at position 0 in '*'.

based on the response:

{
  "error": {
    "code": "BadRequest",
    "message": "Syntax error: character '*' is not valid at position 0 in '*'.",
    "innerError": {
      "date": "2025-03-31T18:56:12",
      "request-id": "f29db1f9-b0d7-4d4b-a724-7599a932bcca",
      "client-request-id": "fb1f170c-a4c0-4eb6-bb8c-852e3d3c7762"
    }
  }
}

These inconsistencies (along with issues like #2344 and #2345 ) make it very difficult to sanely develop applications using the MS Graph SDK.

One difference is that I am using client cert / secret credentials for the SDK and personal credentials for Explorer. That should not affect the API's functional behavior though.

Expected behavior

APIs should have consistent behavior.

How to reproduce

See above.

SDK Version

6.33.0

Latest version known to work for scenario above?

No response

Known Workarounds

Pull out hair, write code with many "argh" comments, and proceed

Debug output

No response

Configuration

No response

Other information

No response

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 /v1.0/sites requests in Graph Explorer and with SDK version 6.33.0, comparing the credentials and serialized search query. Trace whether the discrepancy is in the Java SDK request or the Graph API behavior; done means the responsible component and a consistent behavior or documented limitation are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.