[BUG] [Java] Getter/Setter naming convention not followed in generated models
Created by: karismann
Description
When generating a client library, the getters/setters for a field pId
are getPId()
and setPId()
.
As per naming conventions, this is wrong :
- https://stackoverflow.com/questions/2948083/naming-convention-for-getters-setters-in-java
- https://download.oracle.com/otn-pub/jcp/7224-javabeans-1.01-fr-spec-oth-JSpec/beans.101.pdf?AuthParam=1548672501_cd9f95cc049ee0220b70f6c448b2a095 (chapter 8)
- https://dertompson.com/2013/04/29/java-bean-getterssetters/
This should be getpId()
and setpId()
openapi-generator version
4.0.0-SNAPSHOT
OpenAPI declaration file content or url
...
"xField" : {
"type" : "string"
},
...
Command line used for generation
Steps to reproduce
Here also the automated getter and setter generated by IntelliJ for this property :
public class TestClass {
String pId;
public String getpId() {
return pId;
}
public void setpId(String pId) {
this.pId = pId;
}
}
Related issues/PRs
https://github.com/swagger-api/swagger-codegen/issues/8282
Suggest a fix
I will send a PR