-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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][aspnetcore][csharp][csharp-dotnet2] allOf generates source code for *AllOf model #3338
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
This is affecting other clients as well. I see the same problem for Java and Typescript at least. |
Thanks for reporting the issue. Can you please check the latest master? if it's still an issue, I'll take a look in the next 2 weeks after I'm back from my trip. |
I've just checked with latest master but it generates three files
and ExtendedErrorModel does not inherit from the ErrorModel: |
@oleksabor As to why the *AllOf.cs models are generated, this is a separate issue that should be fixed. |
There is the same problem in Ruby client. Tried in version 4.1.1 and 4.2.0 |
I've filed a PR (#13498) related to this. Please refer to #3100 (comment) for the instruction to try it out. closing this one as we'll use #3100 to track |
Closed via #15682 Please pull the latest master to give it a try. |
Description
I've tried to use allOf to check inherited classes case. But the problem is that it generates surplus model class
ExtendedErrorModelAllOf.cs
among withErrorModel.cs
ExtendedErrorModel.cs
I expect that
ExtendedErrorModelAllOf.cs
should not be generated.openapi-generator version
v4.0.3
OpenAPI declaration file content or url
classInherit.yml.zip
Command line used for generation
java -jar D:/os/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i classInherit.yml -g aspnetcore -o d:\temp\ErrorMessage
java -jar D:/os/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i classInherit.yml -g csharp -o d:\temp\ErrorMessage
java -jar D:/os/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i classInherit.yml -g csharp-dotnet2 -o d:\temp\ErrorMessage
Steps to reproduce
clone openapi-generator
checkout v4.0.3
build mvnw package
get classInherit.yml
run commands
Related issues/PRs
Suggest a fix
I suppose the reason is in the AbstractCSharpCodegen since all three c# is affected.
probably it happens because of ExtendedErrorModel has
-ref$
and-type
The text was updated successfully, but these errors were encountered: