Skip to content

[BUG] [Java] Getter/Setter naming convention not followed in generated models #2085

@karismann

Description

@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 :

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

swagger-api/swagger-codegen#8282

Suggest a fix

I will send a PR

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions