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
When using `@JsonProperty` on a bean property (i.e. a field with
accessor methods), if you do not specify an explicit name for the
property, the `ScalaAnnotationIntrospector` was incorrectly generating
properties for the accessor methods.
In the following example:
```
class Bean {
private var value: Int = 0
@JsonProperty
def getValue: Int = value
@JsonProperty
def setValue(value: Int): Unit = { this.value = value }
}
```
A mapper configured with the `ScalaAnnotationIntrospector` would
serialize this to:
```
{"value":0,"getValue":0}
```
This most notably impacts interop with Java-defined classes, as they
often follow the pattern of Java Beans, where the accessor methods are
annotated with `@JsonProperty`.
Credit for the fix goes to @clintmiller1
(FasterXML#224 (comment)).
I've included a test that verifies the problem, and the solution.
0 commit comments