microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

Analyzer for RequestInformation

Open
#1,930 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Request: enhancement Status: Needs investigation
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Let's pick on one example from https://github.com/microsoftgraph/dotnet-aad-query-sample/blob/main/GraphDataService/GraphDataService.cs

        public IAsyncEnumerable<Group> GetGroups(string[] select, string filter, string[] orderBy, string search)
        {
            var requestInfo = _graphClient.Groups
                    .ToGetRequestInformation(rc =>
                    {
                        rc.Headers = EventualConsistencyHeader;
                        rc.QueryParameters.Count = true;
                        rc.QueryParameters.Select = select;
                        rc.QueryParameters.Filter = filter;
                        rc.QueryParameters.Orderby = orderBy;
                        rc.QueryParameters.Search = search;
                    });

            LastUrl = WebUtility.UrlDecode(requestInfo.URI.AbsoluteUri);
            return requestInfo.ToAsyncEnumerable<Group, GroupCollectionResponse>(_graphClient.RequestAdapter);
        }

Here - obviously - the eventual consistency header is set. However, having a Roslyn analyzer/fix that would tell me if I actually forgot it in a call where it should have been added to RequestInformation would be great (eg the ASP.NET team does ship such best practices or deprecated patterns analyzers).

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 with the RequestInformation usage shown in GraphDataService/GraphDataService.cs and investigate how the .NET SDK represents the eventual consistency header. Define which requests require the header and how a Roslyn analyzer and code fix would identify and address missing usage; done means those patterns are diagnosed reliably with an actionable fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.