-
Notifications
You must be signed in to change notification settings - Fork 430
Handle value set with setters the same way than with the additionalProperties map #55
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
Comments
I have opened a pull request to solve this: #56 |
My concern about the feature in #43, and now in #56, is that we're ignoring how can affect future migrated generators. Honestly i have not tested how the This happen with just migrate the generator (no extra change related to the I'd like to know wdyt about it, and also would like to know what problem you see to implement #56 in children classes |
I am really sad to read this. There is already a lot of work required to migrate from v2 to v3. Starting with:
I try to keep this wiki-page up to date: Swagger Codegen migration (swagger codegen generators repository). I am well aware of each of the requested changes. And the most blocking factor for me: time requested to review and merge PR. I consider none of the mentioned issue as blockers to move forward and I try to help were I can. See all my contributions of the past weeks.
Of course this can be made as you describe but this is a bad idea in my opinion. With your solution: each subclass that rely on this value should implement the check logic (which will be the case in most of the use-cases). This is a wrong separation of concern in Object-Oriented programming. Now for one specific generator ( For me your solution looks like this:
In my opinion, moving the "package definition" handling for the |
come on, this is not to make you feel sad :) I see your point about OO and you're right about it, so let's keep it that way. I'll try to help you with PR review, sometime is difficult to me because other tasks. |
btw, thanks again for your help, and sorry for this mess i made o.O |
Fixes for the php client generator: #57, the key point is commit 3e96e04. As you can see: Tests introduced in PhpClientCodegenTest bevore the merge of commit b6724d3 (containing the changes to solve this issue) are still OK. This ensures no regression in package management for the php-client. |
Wiki updated with a new section: Package Name handling. |
This feature was implemented with #43 and removed with #54.
The framework is providing two ways to set values:
additionalProperties
map.From a usage point of view, setting a value in one way or an other one should create no difference:
Setter:
Map:
In my opinion, using setters is more natural, but both way are offered and needs to be supported.
Because of this dual way to set value, the
Codegen
classes need to conciliate both way and ensure that everything is consistent. This is done inprocessOpts()
. The values need to be available in the templates (using{{artifactId}}
or{{modelPacakge}}
from the previous example), no matter if they were set the map or the setter way.To solve this issue, the commit aa9e90b pushed with PR #54 needs to be reverted.
The text was updated successfully, but these errors were encountered: