microsoft / microsoft/kiota

ArgumentException when trying to generate client from Azure specification

Open
#7,158 3 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

I am trying to create an API client based on https://raw.githubusercontent.com/Azure/azure-rest-api-specs/refs/heads/main/specification/ai/data-plane/OpenAI.v1/azure-v1-v1-generated.json and I observe an ArgumentException in FindChildByName and the client is not generated. Trying to use the specification with https://editor.swagger.io/ seems to work with some warnings. The problem seems to be with ResponseModalities, though not sure I understand why.

### Expected behavior

Generate client should work without an exception.

### How to reproduce

```
kiota generate --openapi https://raw.githubusercontent.com/Azure/azure-rest-api-specs/refs/heads/main/specification/ai/data-plane/OpenAI.v1/azure-v1-v1-generated.json --language CSharp --namespace-name Test --class-name Client --output Test --exclude-backward-compatible --serializer Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory --deserializer Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory --structured-mime-types application/json --include-path "**/chat/*" --clean-output
```

### Open API description file

https://raw.githubusercontent.com/Azure/azure-rest-api-specs/refs/heads/main/specification/ai/data-plane/OpenAI.v1/azure-v1-v1-generated.json

### 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 running the reported Kiota 1.29.0 command against the linked Azure OpenAPI specification, then inspect the FindChildByName failure around ResponseModalities. Compare the behavior with the warnings from editor.swagger.io; done means the C# client is generated without an ArgumentException.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.