-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[Java] option for the prefix of boolean getters #432
Conversation
If this PR is for 3.1.0, I suggest making the change to get as default now |
@cbornet: yes current change is as minimal as possible (no impact on the generated code). |
I have pushed some more commits to change the default value. I also think that it is important for our users to have a short list of the breaking changes in a major/minor release. I have started |
* Links to labels * Link to PR
@macjohnny and @cbornet (you were both interested by the feature in a previous conversation), any additional feedback on this? I would like to merge this, but until now nobody gave it a try. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a test locally and work as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, although I haven't tested it
Input @cbornet:
|
At paragraph 8.3 😄 |
* Add "booleanGetterPrefix" option * Create `docs/migration-guide.adoc`
Does this apply to other languages too? Or is this just java? jaxrs-jersey I still see isX getter. |
The enhancement is made to the abstract java codegen class, which should cover all java generators. Maybe the mustache template needs to be updated. Welcome PR to plot the enhancement form Java client mustache/generator to JAX-RS templates/generators. |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,3.1.x
,4.0.x
. Default:master
.Java: @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01)
Description of the PR
This PR adds a new option to all java generators (java client, jaxrs server, spring, …):
booleanGetterPrefix
This new option influence the name of the getter generated for a boolean property in a model.
Example values for
booleanGetterPrefix
:is
: default value in3.0.x
.get
: new default value starting with3.1.0
With following OAS3 (extract):
Generated code with
is
value:With
get
value:This was also discussed in: