-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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-netcore] Duplicate methods in model class #14350
Comments
Having the same issue |
The duplicated methods in this case can be fixed via the e.g.
|
Using openapi-generator-cli-6.5.0-20230329.141901-70.jar I tested this. It is fixed though there's no validation code to ensure anyOf or oneOf constraints are met. In one example, there's still a problem (code does not compile): HssAuthenticationVectors in file https://forge.3gpp.org/rep/all/5G_APIs/-/blob/REL-16/TS29503_Nudm_UEAU.yaml . The generated code has three GetList() methods that differ only by the return type. |
it's fixed by #15007 instead. Please enable the option |
Tried with openapi-generator-cli-6.5.0-20230329.141901-70.jar few weeks back. Was able to compile the generated code.
Generated code is:
|
@arvindpdmn did you enable the option |
Yes. |
@arvindpdmn for the following:
What's the URL to the full spec so that I can try to repeat the issue locally? |
This is the URL: https://forge.3gpp.org/rep/all/5G_APIs/-/blob/REL-16/TS29503_Nudm_SDM.yaml Full command used in Gradle (I used local filename rather than the URL above):
|
Bug Report Checklist
Description
When
oneOf
oranyOf
constructs are used, the generated model file has duplicate constructor and duplicategetObject()
method. There's no reference to the actual properties (aId, bId, cId, dId) in the generated file. These problems are not seen withallOf
. The attached example YAML file usesoneOf
. The same problem will be observed if it's replaced withanyOf
.With
aspnetcore
, the model file has no duplicates but shows other problems, such as no constructor. This issue focuses only oncsharp-netcore
.openapi-generator version
Version used is 6.2.1. Did not test against the latest commit on the master branch.
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Just run the command above and check the generated model file. We will see the duplicates.
Related issues/PRs
This could be related: #8382
Suggest a fix
None at the moment
The text was updated successfully, but these errors were encountered: