Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
McMlok opened this issue Sep 26, 2024 · 0 comments · Fixed by #19913
Closed

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

McMlok opened this issue Sep 26, 2024 · 0 comments · Fixed by #19913

Comments

@McMlok
Copy link

McMlok commented Sep 26, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant