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

C# Code snippet generation for filters in wrong format #2091

Open
MatthewMuir-MLI opened this issue Jun 21, 2024 · 0 comments
Open

C# Code snippet generation for filters in wrong format #2091

MatthewMuir-MLI opened this issue Jun 21, 2024 · 0 comments

Comments

@MatthewMuir-MLI
Copy link

Describe the bug
I am using the Graph Explorer web app to test endpoints before adding them to my .NET project. A successful http request should generate a successful code snippet. But when I retrieve the code snippet from this section and attempt to use it in my project it throws the following exception.
"Invalid filter clause: Syntax error at position 17 in 'jobtitle ge '!' , accountenabled eq true'."

Here is the code snippet from the graph explorer (that throws an error)
var result = await graphClient.Users.GetAsync((requestConfiguration) => { requestConfiguration.QueryParameters.Filter = "jobtitle ge '!' , accountenabled eq true"; requestConfiguration.Headers.Add("ConsistencyLevel", "eventual"); });
And here is the working code
var result = await graphClient.Users.GetAsync((requestConfiguration) => { requestConfiguration.QueryParameters.Filter = "jobtitle ge '!' and accountenabled eq true"; requestConfiguration.Headers.Add("ConsistencyLevel", "eventual"); });

To Reproduce
Steps to reproduce the behavior:

  1. Go to Graph Explorer page
  2. Enter a multi-filter http GET https://graph.microsoft.com/v1.0/users?$filter=jobtitle ge '!' &$filter= accountenabled eq true
  3. After successfully running query click Code Snippets tab.
  4. The C# snippet filter is formatted incorrectly.

Expected behavior
I should be able to copy the code form the snippet into my project

@Michael-Wamae Michael-Wamae transferred this issue from microsoftgraph/microsoft-graph-explorer-v4 Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant