microsoft / microsoft/kiota

Paths /v1.1/ and /v11/ collide

Open
#7,143 0 comments 0 reactions 0 assignees View on GitHub
Csharp type:bug
Dominant language
C#
Stars
3.8k
Forks
333
Avg merge
16h 29m
Merged PRs (30d)
116

Description

### What are you generating using Kiota, clients or plugins?

API Client/SDK

### In what context or format are you using Kiota?

Nuget tool

### Client library/SDK language

Csharp

### Describe the bug

When generating a client with versions in paths, then 1.1 and 11 collide.

```
/v1.1/tests
/v11/tests
```

Because 1.1 becomes 11. This causes one of the endpoints to be overwritten, I think this is related to the order they appear in the openapi spec - not tested

This result in a generated client that only has
```c#
client.V11.Tests.GetAsync();
```

### Expected behavior

The client should have both v1.1 and v11 endpoints

### How to reproduce

1. `dotnet kiota generate -l CSharp -d --exclude-backward-compatible --clean-output`
2. observe generated output
- doesn't have a v1.1
- it does have a v11
- v11 is actually v1.1
- so the real v11 is missing

### Open API description file

```yml
openapi: 3.0.1
info:
title: Test
version: 1.0.0
paths:
/v1.1/tests:
get:
tags: [v1.1]
responses:
"200":
description: Hello from v1.1
content:
text/plain:
schema:
type: string
/v11/tests:
get:
tags: [v11]
responses:
"200":
description: Hello from v11
content:
application/json:
schema:
type: number
```

### Kiota Version

1.29.0

### Latest Kiota version known to work for scenario above?(Not required)

_No response_

### Known Workarounds

_No response_

### Configuration

_No response_

### Debug output

Click to expand log
```

```

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the inline OpenAPI description and the listed dotnet kiota generate command. Trace the client-name generation for /v1.1/tests and /v11/tests, then find the generator tests covering path-name collisions. Done means the generated C# client exposes distinct operations for both endpoints and the regression case passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, openapi
Domain
api, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.