Skip to content

[BUG] [CSHARP] Duplicit interface names when tags for method are used #19686

@McMlok

Description

@McMlok
Description

When I define multiple tags and add more than one to path definition csharp generator generates multiple Response interfaces with same. Then to code doesn't compile.

openapi-generator version

openapi-codegen-cli-7.8.0.jar

OpenAPI declaration file content or url

sample api defintion

Generation Details

java.exe -jar .\openapi-generator-cli.jar generate -i '.\duplicit-classes.yaml' -g csharp -o .\test\ --additional-properties='library=generichost,targetFramework=net8.0,excludeTests=true,nullableReferenceTypes=true,useOneOfDiscriminatorLookup=true,packageName=Test.Client'

Steps to reproduce

Generate code with command above open in VS and compile or use dotnet build command

Suggest a fix

use {{interfacePrefix}}{{operationId}}{{classname}}Response as interface name instead of {{interfacePrefix}}{{operationId}}ApiResponse in api.mustache

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions