I'm using swagger-codegen-maven(3.0.29) plugin to generate code. However, I see that boolean is generated with isXXX instead of getXXX. Is there a way to generate getXXX.
swagger code
Data:
required:
- id
properties:
verified:
description: >-
Id
example: true
pattern: ^true|false$
type: boolean
generated code
@NotNull
@Schema(example = "true", required = true)
public Boolean isVerified() {
return verified;
}
public void setVerified(Boolean verified) {
this.verified = verified;
}
}
CodePudding user response:
According to their github issues, that enhancement is available on 3.1.x of OpenAPI-generator and that will have to be implemented on swagger-codegen-maven which currently seems to be not implemented.
Version 3.1.0 is the first minor version of OpenAPI-Generator, in comparison to 3.0.3 it contains some breaking changes, but with the possibility to fallback to the old behavior. The default value of some options might change. Projects relying on generated code might need to be adapted.
Please, check out the issues.
