Srilalitha S
Srilalitha S

Reputation: 1

Jackson Annotations stopped working after spring boot upgrade

I am trying to update a backend Java application(Java 21). It has been using spring boot 3.1.3 that works with jackson 2.15.2. But soon as I upgraded it to spring boot to 3.1.4, Jackson still uses 2.15.2 but the jackson annotations are not working.

Scenario: We have an string attribute on a record annotated with @JsonGetter, that is supposed to return the lowercase of the value on every call or invoking of the attribute which works fine with Spring 3.1.3 but doesn't work with 3.1.4(it returns the value in uppercase when invoking the attribute via spoc tests). There is also a lombok builder on top the record. Lombok version 1.18.32

@Builder
public record MyRecord(MyAttributeEnum myAttribute) {

@JsonGetter
    public String getMyAttribute() {
        return myAttribute.name().toLowerCase();
    }
}

Now the below test is failing

verifyAll(myRecord) {
it.myAttribute == givenMyAttribute.name().toLowerCase()
}

I tried

Still no luck ;(

Upvotes: 0

Views: 106

Answers (0)

Related Questions