microsoft / microsoft/kiota

Customizing the Structure of Generated Client Code in Kiota

Open
#4,004 10 comments 1 reaction 1 assignee Assigned to @darrelmiller View on GitHub
generator needs more information Needs: Discussion 📢 type:question
Dominant language
C#
Stars
3.8k
Forks
333
Avg merge
16h 29m
Merged PRs (30d)
116

Description

## Issue

Currently, Kiota generates client code based on the structure of the provided OpenAPI document. I have an API that looks like this:

```
/
└─api
└─talks
└─{id}
```

This results in the following API client code:

```csharp
var result = await kiotaClient.Api.Talks.GetAsync();
```

I find this a bit ugly. I'd prefer it to be `kiotaClient.Talks.GetAsync();` because the `Api` doesn't add anything.

Is there a way to do this? Lots of API's have `api/` in their path, so I don't think this is an exceptional case :)

My code can be found here: https://github.com/sander1095/openapi-code-generation-talk/tree/main/api-client-generation-demo

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.