Repository navigation
Spring Boot 4 with Jackson 3, How to Set a Default Request Body Value #373
Unanswered
gtaverniti-finomnia
asked this question in
Q&A
Replies: 2 comments
|
Please talk to Spring team. |
0 replies
|
I assume those |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I upgraded my application from Spring Boot 3 to Spring Boot 4, so I also updated Jackson. However, I encountered a problem.
If I have an endpoint that takes an object like
@RequestBodyand I define an attribute like this inside it:private boolean required = true;The default value of "true" is ignored, while this wasn't the case with Jackson 2.
If I try to add this property
spring.jackson.use-jackson2-defaults= trueIt actually works again, but I'd like to avoid using it because I imagine it will eventually be removed. So, I don't want to depend on Jackson 2 in any way; I prefer to define the necessary properties myself.
The problem is solved even if I use
spring.jackson.mapper.detect_parameter_names= falseBut I'm not sure what this property does. So, is there a proper way to make the default value definition within the class work as it did before?
I tried using Boolean type instead of primitive but it doesn't solve the problem
All reactions