Created by: jmini
PR checklist
-
Read the contribution guidelines. -
Ran the shell script under ./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\
. -
Filed the PR against the correct branch: master
,3.1.x
,4.0.x
. Default:master
. -
Copied the technical committee to review the pull request if your PR is targeting a particular programming language. 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):
components:
schemas:
schemas:
Order:
type: object
properties:
id:
type: integer
format: int64
status:
type: string
enum:
- placed
- approved
- delivered
complete:
type: boolean
Generated code with is
value:
public Boolean isComplete() {
return complete;
}
With get
value:
public Boolean getComplete() {
return complete;
}
This was also discussed in:
- swagger-api/swagger-codegen#7261
- swagger-api/swagger-codegen#7764
- swagger-api/swagger-codegen#7638
- ...