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] When using word Channel as part of assembly name generator produces code which could not compile #19682

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

Comments

@McMlok
Copy link

McMlok commented Sep 26, 2024

Description

When I generate API with csharp generator and use word Channel in packageName with library = generichost code is generated but is unable to compile. Problem is in RateLimitProvider where on line 42 is error "The type or namespace name 'CreateBounded' does not exist in the namespace 'Test.Channel' (are you missing an assembly reference?)"

openapi-generator version

I'm using version openapi-codegen-cli-7.8.0.jar

OpenAPI declaration file content or url

https://gist.github.com/McMlok/a3d8a858af888479cbbe406056042a3a

Generation Details

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

Steps to reproduce

Run generator

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

Add on line 42 before Channel System.Threading.Channels. or add word 'Channel' to reserved

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