You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The intention of the example below is that the bean's value is serialised as both ownerUid and accountOwnerUid and that deserialisation uses the ownerUid value. The example can be made to work by removing the ParameterNameModules and relying on the @JsonProperty annotation. It appears to be rather a contrived example (it reflects some real examples, promise); I wanted to report it because I feel that it's fairly clear what the code should do and the behaviour is unexpected.
The error when running the test using Jackson 2.9.9.1 is: com.fasterxml.jackson.databind.JsonMappingException: Conflicting getter definitions for property "ownerUid": com.example.rest.server.RestServerJacksonModuleTest$TestBeanWithAnnotationsAndDeprecation#getOwnerUid(0 params) vs com.example.rest.server.RestServerJacksonModuleTest$TestBeanWithAnnotationsAndDeprecation#getAccountOwnerUid(0 params)
The difference between running the test with the parameter names module is that _renameProperties in POJOPropertiesCollector decides that the property needs to be renamed. The breakpoint in there is not hit without the parameter names module being registered with the ObjectMapper.
The text was updated successfully, but these errors were encountered:
davidboden
changed the title
Conflicting getter definitions when using @JsonProperty annotation which overrides constructor parameter name
ParameterNameModule: Conflicting getter definitions when using @JsonProperty annotation which overrides constructor parameter name
Jul 21, 2019
davidboden
changed the title
ParameterNameModule: Conflicting getter definitions when using @JsonProperty annotation which overrides constructor parameter name
ParameterNamesModule: Conflicting getter definitions when using @JsonProperty annotation which overrides constructor parameter name
Jul 21, 2019
The intention of the example below is that the bean's value is serialised as both
ownerUid
andaccountOwnerUid
and that deserialisation uses theownerUid
value. The example can be made to work by removing the ParameterNameModules and relying on the @JsonProperty annotation. It appears to be rather a contrived example (it reflects some real examples, promise); I wanted to report it because I feel that it's fairly clear what the code should do and the behaviour is unexpected.The error when running the test using Jackson 2.9.9.1 is:
com.fasterxml.jackson.databind.JsonMappingException: Conflicting getter definitions for property "ownerUid": com.example.rest.server.RestServerJacksonModuleTest$TestBeanWithAnnotationsAndDeprecation#getOwnerUid(0 params) vs com.example.rest.server.RestServerJacksonModuleTest$TestBeanWithAnnotationsAndDeprecation#getAccountOwnerUid(0 params)
The difference between running the test with the parameter names module is that
_renameProperties
inPOJOPropertiesCollector
decides that the property needs to be renamed. The breakpoint in there is not hit without the parameter names module being registered with the ObjectMapper.The text was updated successfully, but these errors were encountered: