microsoft / microsoft/kiota

Mark request builder getters deprecated if all their child methods are too

Open
#6,842 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
C#
Stars
3.8k
Forks
333
Avg merge
16h 29m
Merged PRs (30d)
116

Description

Is your feature request related to a problem? Please describe the problem.

While testing different API specs, I noticed that some contain deprecated endpoints. That in itself is propagated through deprecation annotations in every language.

However, since Kiota builds a class structure around the URL paths, it should recursively mark request builders as deprecated, if all of their endpoints and child request builders are deprecated.

For example:

Say, I have an endpoint /packages/{package}/version/{version}.tar.gz. It is marked deprecated.

In generated code, you'd have a hierarchy like:

ApiClient                                             
  .packages ───────► PackagesRequestBuilder           
    .byPackage() ──► WithPackageItemRequestBuilder    
      .versions ───► VersionsRequestBuilder           
        .withVersionTarGz() ◄─ only this is marked "deprecated"

Now let's also say this is the only endpoint under /packages/.

It wouldn't make sense to only mark withVersionTarGz as deprecated, right?

Client library/SDK language

None

Describe the solution you'd like

I'd like Kiota to check if all endpoints in any given request builder are deprecated, mark it deprecated and repeat the whole process one layer above.

This way, all paths that are deprecated are marked as such, as opposed to only the final methods (or leaf nodes).

Additional context

No response

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

No source file, test, or entry point is named. Start by tracing how Kiota propagates deprecation annotations while generating request-builder hierarchies, then identify where child endpoints and builders are evaluated. Done means a request builder is marked deprecated when all its endpoints and child builders are deprecated, with that result recursively propagated upward.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, openapi
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.