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

Skip generation for the /me endpoints #1437

Assignees
Milestone

Comments

@maisarissi
Copy link
Contributor

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().get();

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 for /me to /users

NOTE: the list above was copied from the Go repo. Apply as needed.

@ghost ghost added the ToTriage label May 4, 2023
@maisarissi maisarissi added this to the 6.0.0 milestone May 4, 2023
@ghost ghost removed the ToTriage label Jun 15, 2023
@maisarissi
Copy link
Contributor Author

As part of the /me work, we also need to make sure to address the issue mentioned here where batch requests using /me segment are generating incorrect URLs.

@baywet
Copy link
Member

baywet commented Jul 19, 2023

as a quick correction here: the handler and the option itself should live in Kiota java so it can be reused by other APIs. The rest still should be in java core or in the service libs as described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment