OpenAPITools / OpenAPITools/openapi-generator
[BUG] Automatically generated C# .NET core client ActuatorApi.cs missing "using" statement for the model classes
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
The C# .NET Core generated client fails to build because ActuatorApi.cs is missing "using" statement for the model classes.
Build passes once using Org.OpenAPITools.Model; is manually added to ActuatorApi.cs.
openapi-generator version
openApiGeneratorPluginVersion = '5.2.1'
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Find reprex here: https://github.com/vchen8761/open-api-generator-reprex
- Build project in CLI using:
./gradlew clean build - Run additional script to generate C# Client:
./gradlew codegenSdkCSharpNetCore - Navigate to build directory:
cd .\build\sdk\csharp-netcore\ - Build dotnet client:
dotnet build - Build fails with error CS0246
- Add
using Org.OpenAPITools.Model;tobuild/sdk/csharp-netcore/src/Org.OpenAPITools/Api/ActuatorApi.cs - Build passes
Related issues/PRs
Suggest a fix
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with ./gradlew clean build and ./gradlew codegenSdkCSharpNetCore, then inspect build/sdk/csharp-netcore/src/Org.OpenAPITools/Api/ActuatorApi.cs. Confirm the generated client fails with CS0246 and that adding the reported model namespace makes dotnet build pass; done means generation produces a buildable client without that manual edit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, java
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100