microsoftgraph / microsoftgraph/msgraph-sdk-dotnet
Skip generation for the /me endpoints
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 789
- Forks
- 264
- Avg merge
- 15h 17m
- Merged PRs (30d)
- 3
Description
As part of the Go effort to decrease the size and optimize the performance of the pre-package service library, one of the solutions was to map internally all the /me endpoints to target the users/{user-id}.
/me and /users/{id} are effectively identical from a metadata perspective. This presents an opportunity to reduce build time while minimally impacting the experience for users.
We still wanna keep the experience of having .Me as part of the fluent API, so while we are removing the /me path we still need to be able to do something as the following:
client.Me.GetAsync()
TODO:
- in graph core, add a UrlReplaceOption request option. It needs to implement the interface and provide accessors for Enabled (default true) as well as "ReplacementPairs" (map[string]string), default [/users/me-token-to-replace, /me]
- in graph core add a UrlReplaceHandler that implements the middleware handler, replaces the tokens in the URLs, and traces its activity with the telemetry.
- in graph core, add this new handler as part of the defaults
- in code generator, update the go weekly generation steps to exclude /me (exclude paths, /me and /me/**, or something similar)
- trigger a code generation from beta
- in that newly generated PR, update the dependency to core
- in that newly generated PR, cherry pick the first commit
- update the snippets generation to map inline types and namespacing for /me to /users
NOTE: the list above was copied from the Go repo. Apply as needed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in graph core with the requested UrlReplaceOption and UrlReplaceHandler, then inspect the default middleware configuration. Next review the code generator's Go weekly generation exclusions and the snippets generation workflow. Done means /me is omitted from generated paths while client.Me.GetAsync() continues to work through URL replacement, with the generated dependency and cherry-picked changes updated as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100