Skip to content

Missing usings if "ImplicitUsings" is disabled #7248

@WolfgangHG

Description

@WolfgangHG

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

See attached sample: the client is created from https://api.twitter.com/2/openapi.json
XKiota.zip

The project does not enable ImplicitUsings (as might happen for older projects).

There are two compilation errors due to missing using statements in class MediaSegments

The type or namespace name 'IDictionary<,>' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'Action<>' could not be found (are you missing a using directive or an assembly reference?)

Expected behavior

Two usings should be added:

using System;
using System.Collections.Generic;

How to reproduce

I used this command to create the client:

dotnet kiota generate -l CSharp -c TwitterClient -n XKiota.Client -d https://api.twitter.com/2/openapi.json -o ./Client --exclude-backward-compatible

Open API description file

https://api.twitter.com/2/openapi.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