Open mongo-o opened 2 years ago
The problem here is that the getter getIRightGroupName
is not being associated with the field iRightGroupName
. Jackson's property naming logic thinks the getter is for a property called irightGroupName
(lowercase r
). You have multiple options here:
@JsonProperty
will apply correctly@JsonProperty
annotation@JsonProperty
to the getter instead of the field – there's really no reason to have it on the field, here, and if you move it to the getter, property detection will simply ignore the field@JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
(you should do the same for the setter too, then)What @yawkat says: your naming convention is non-standard (wrt Bean naming) and Jackson needs some help with annotations.
I would remove annotations from fields and move to getter (and for that one oddly named property, also setter). There is usually no point in annotating fields if you have getters and setters.
Describe the bug when i serialize the DomainGroupDto instance , the always get one more property “irightGroupName” which do not declared。 the result is :
The DomainGroupDto define as below :
Version information v2.12.3
To Reproduce
Expected behavior
Additional context below is my debug image where the reason is ,the undeclared property is from the method "getIRightGroupName".