Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upLombok 1.16.20 breaks Jackson serialization when using Builder annotation #12568
Labels
Comments
|
Sorry but we can't document breaking changes in third party libraries. Spring Boot doesn't do anything with Lombok besides providing dependencies management for it so that's something that needs to be prominent in the Lombok release notes and/or documentation. |
|
This is related to this ticket in Jackson, because it's for some reason still requiring those additional annotations despite the fact that the Java 8 parameter names module is on the classpath. I.e. this is a Jackson issue fundamentally, not a Lombok one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Spring Boot 1.5.10 the lombok dependency was updated to 1.16.20, which has a breaking change on how constructor properties are generated when using the
@Builderannotation. This basically breaks all your JSON serialization for the affected classes.This is the issue logged against Lombok: rzwitserloot/lombok#1563
There are currently two workarounds that I tested that seems to work:
lombok.anyConstructor.addConstructorProperties=trueTo reproduce the problem, please see sample classes below:
When doing the POST to this endpoint, you will get a weird "Unsupported Media Type" exception, which was very confusing before finding the solution.
Error:
I am not sure what the long term fix for this would be. Maybe the lombok.config file should be included on the start.spring.io project template OR at least we should document the workaround somewhere in the Spring Boot documentation.