OpenAPITools / OpenAPITools/openapi-generator

[BUG] aspnetcore generating uncompilable csproj-File

Open
#6,492 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

I generate a aspnetcore-Server and on building the docker-image i get this error:
Controllers/VersionApi.cs(41,56): error CS0104: 'Version' is an ambiguous reference between 'Org.OpenAPITools.Models.Version' and 'System.Version' [/app/Org.OpenAPITools.csproj]

openapi-generator version

4.3.1

OpenAPI declaration file content or url

https://gist.github.com/StefanWetterActiware/162b2b32a7615a8f5dd2fe58e0ec80c2

Command line used for generation

java -jar openapi-generator-cli-4.3.1.jar generate -i sdd-api-V1.yml -g aspnetcore

Steps to reproduce
docker build .

to the generated code

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by generating the aspnetcore server with the linked OpenAPI declaration and the shown openapi-generator 4.3.1 command, then run docker build. Inspect Controllers/VersionApi.cs and the generated project around the ambiguous Version reference; done means the generated csproj builds without CS0104.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.