[Java] option for the prefix of boolean getters#432
[Java] option for the prefix of boolean getters#432jmini merged 8 commits intoOpenAPITools:masterfrom
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. |
wing328
left a comment
There was a problem hiding this comment.
Did a test locally and work as expected.
macjohnny
left a comment
There was a problem hiding this comment.
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.shand./bin/security/{LANG}-petstore.shif 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, …):
booleanGetterPrefixThis 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.0With following OAS3 (extract):
Generated code with
isvalue:With
getvalue:This was also discussed in: