Skip to content

ArgumentException when trying to generate client from Azure specification #7158

@gpetrou

Description

@gpetrou

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

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 ```
</details>


### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    CsharpPull requests that update .net codestatus:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    Status

    Needs Triage 🔍

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions