jsonschema-generator icon indicating copy to clipboard operation
jsonschema-generator copied to clipboard

Fields with Getters that are not conforming to Java beans naming conventions are ignored

Open schmidti159 opened this issue 6 months ago • 2 comments

Having a field like this, I would expect it to be present in the json schema, but it is not, when the Jackson module is enabled:

class MyDto {
    private String aField;

    public int getAField() {
        return aField;
    }
}

I saw that FieldScope already has some special handling to support these getters, but the field will be filtered here: https://github.com/victools/jsonschema-generator/blob/db77aa15da9d7a5f4f8dddf2f562c5af6afb3ade/jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JacksonModule.java#L305

I prepared a failing test and a workaround in this PR. Feel free to modify to your liking.

schmidti159 avatar Jul 03 '25 13:07 schmidti159