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
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 @Builder annotation. This basically breaks all your JSON serialization for the affected classes.
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:
{
"timestamp": 1521622061005,
"status": 415,
"error": "Unsupported Media Type",
"exception": "org.springframework.web.HttpMediaTypeNotSupportedException",
"message": "Content type 'application/json;charset=UTF-8' not supported",
"path": "/api/test"
}
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.
The text was updated successfully, but these errors were encountered:
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.
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
@Builder
annotation. This basically breaks all your JSON serialization for the affected classes.This is the issue logged against Lombok: projectlombok/lombok#1563
There are currently two workarounds that I tested that seems to work:
lombok.anyConstructor.addConstructorProperties=true
To 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.
The text was updated successfully, but these errors were encountered: