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

Incorrect namespace assigned to 'UrlTemplate' in the Security RunHuntingQuery builder #1691

Closed
3 tasks done
udaykiranravuri opened this issue Mar 8, 2023 · 3 comments · Fixed by #1870
Closed
3 tasks done

Comments

@udaykiranravuri
Copy link

Please provide the following (and please check them off the list with [x]) before submitting this issue:

  • Expected behavior. Please provide links to the specific Microsoft Graph documentation you used to determine the expected behavior.
  • Actual behavior. Provide error codes, stack information, and a Fiddler capture of the request and response (please remove personally identifiable information before posting).
  • Steps to reproduce the behavior. Include your code, IDE versions, client library versions, and any other information that might be helpful to understand your scenario.

Expected behavior

Post call to run hunting queries should work as expected.

Actual behavior

Calls fail with the oDataError (using Graph v5 nuget) with code '400' and message 'Resource not found for segment 'security.runHuntingQuery''

Steps to reproduce the behavior

try {
var requestBody = new RunHuntingQueryPostRequestBody() { Query = "" };
var queryResults = await new GraphServiceClient().Security.SecurityRunHuntingQuery.PostAsync(requestBody, cancellationToken: cancellationToken).ConfigureAwait(false);
}
catch (oDataError error) {
}

@ghost ghost added the Needs: Triage label Mar 8, 2023
@andrueastman
Copy link
Member

Thanks for raising this @udaykiranravuri

This can be worked around as the metadata issue is resolved.

var requestBody = new RunHuntingQueryPostRequestBody() { Query = "" };
                var requestInformation = graphClient.Security.SecurityRunHuntingQuery.ToPostRequestInformation(requestBody);
                requestInformation.UrlTemplate = "{+baseurl}/security/runHuntingQuery";

                var queryResults = await graphClient.RequestAdapter.SendAsync<HuntingQueryResults>(requestInformation, HuntingQueryResults.CreateFromDiscriminatorValue);

@andrueastman
Copy link
Member

Related to microsoft/OpenAPI.NET.OData#365

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants